#Japanese party positions 
#JBS 03/18/2008
#SOP 05/06/2008
#JBS 1 August 2008
#Updated JBS 15 September 2008
#JBS 31 Oct Sept 2008

#Runs results without small upper house parties



rm(list=ls(all=TRUE)) 
library(foreign)

setwd("/Users/jonslapin/Documents/papers and diss/Japan/new data and scripts Sept 19 08")
#setwd("/Users/soproksch/Documents/UCLA/Projects/Current/Japanese Manifestos")

dtafull<-read.csv("japan_wc_280908.csv")
attach(dtafull)
                  
###### 1946 ELECTION #######

JCP.1946.Economy<-X1946..JCP..Industrial.Reconstruction.txt+X1946..JCP..Inflation.txt+X1946..JCP..Land.Issues.txt+X1946..JCP..Unemployment.txt+X1946..JCP..Food.txt
JCP.1946.DomesticPolitics<-X1946..JCP..Emperor.System.and.Constitution.txt

JPP.1946.Economy<-X1946..JPP..Industrial.Reconstruction.txt+X1946..JPP..Inflation.txt+X1946..JPP..Land.Issues.txt+X1946..JPP..Unemployment.txt+X1946..JPP..Food.txt
JPP.1946.DomesticPolitics<-X1946..JPP..Emperor.System.and.Constitution.txt

JSP.1946.Economy<-X1946..JSP..Industrial.Reconstruction.txt+X1946..JSP..Land.Issues.txt+X1946..JSP..Unemployment.txt+X1946..JSP..Food.txt
JSP.1946.DomesticPolitics<-X1946..JSP..Emperor.System.and.Constitution.txt

LP.1946.Economy<-X1946..LP..Industrial.Reconstruction.txt+X1946..LP..Inflation.txt+X1946..LP..Land.Issues.txt+X1946..LP..Unemployment.txt
LP.1946.DomesticPolitics<-X1946..LP..Emperor.System.and.Constitution.txt

NCP.1946.Economy<-X1946..NCP..Food.txt+X1946..NCP..Industrial.Reconstruction.txt+X1946..NCP..Inflation.txt+X1946..NCP..Land.Issues.txt+X1946..NCP..Unemployment.txt
NCP.1946.DomesticPolitics<-X1946..NCP..Emperor.System.and.Constitutiton.txt


###### 1947 ELECTION #######

CCP.1947.Economy<-X1947..CCP..Economic.Recovery.txt+X1947..CCP..Financial.Inflation.txt+X1947..CCP..Labor.txt+X1947._CCP._Food.txt
CCP.1947.Societal<-X1947..CCP..Welfare.txt

DP.1947.Economy<-X1947..DP..Economic.Recovery.txt+X1947..DP..Financial.Inflation.txt+X1947..DP..Food.txt+X1947..DP..Labor.txt
DP.1947.Societal<-X1947..DP..Welfare.txt

JCP.1947.Economy<-X1947..JCP..Economic.Recovery.txt+X1947..JCP..Financial.Inflation.txt+X1947..JCP..Food.txt+X1947..JCP..Labor.txt
JCP.1947.Societal<-X1947..JCP..Welfare.txt

JSP.1947.Economy<-X1947..JSP..Economic.Recovery.txt+X1947..JSP..Financial.Inflation.txt+X1947..JSP..Food.txt+X1947..JSP..Labor.txt
JSP.1947.Societal<-X1947..JSP..Welfare.txt

LP.1947.Economy<-X1947..LP..Economic.Recovery.txt+X1947..LP..Financial.Inflation.txt+X1947..LP..Food.txt+X1947..LP..Labor.txt
LP.1947.Societal<-X1947..LP..Welfare.txt


###### 1949 ELECTION #######

CCP.1949.Economy<-X1949..CCP..Adminisrtative.Organization.txt+X1949..CCP..Business.Organization.txt+X1949..CCP..Capital.txt+X1949..CCP..Clothing.txt+X1949..CCP..Currency.txt+X1949..CCP..Food.txt+X1949..CCP..Prices.txt+X1949..CCP..Production.Increase.txt+X1949..CCP..Taxes.txt+X1949..CCP..Unemployment.txt
CCP.1949.Societal<-X1949..CCP..Housing.txt

DLP.1949.Economy<-X1949..DLP...Currency.txt+X1949..DLP..Administrative.Organization.txt+X1949..DLP..Business.Organization.txt+X1949..DLP..Capital.txt+X1949..DLP..Clothing.txt+X1949..DLP..Food.txt+X1949..DLP..Prices.txt+X1949..DLP..Production.Increase.txt+X1949..DLP..Taxes.txt+X1949..DLP..Unemployment.txt
DLP.1949.Societal<-X1949..DLP..Housing.txt

DP.1949.Economy<-X1949..DP..Administrative.Organization.txt+X1949..DP..Business.Organization.txt+X1949..DP..Capital.txt+X1949..DP..Clothing.txt+X1949..DP..Currency.txt+X1949..DP..Food.txt+X1949..DP..Prices.txt+X1949..DP..Production.Increase.txt+X1949..DP..Taxes.txt+X1949..DP..Unemployment.txt
DP.1949.Societal<-X1949..DP..Housing.txt

JCP.1949.Economy<-X1949..JCP..Administrative.Organization.txt+X1949..JCP..Business.Organization.txt+X1949..JCP..Capital.txt+X1949..JCP..Clothing.txt+X1949..JCP..Currency.txt+X1949..JCP..Food.txt+X1949..JCP..Prices.txt+X1949..JCP..Production.Increase.txt+X1949..JCP..Taxes.txt+X1949..JCP..Unemployment.txt
JCP.1949.Societal<-X1949..JCP..Housing.txt

JSP.1949.Economy<-X1949..JSP..Administrative.Organization.txt+X1949..JSP..Business.Organization.txt+X1949..JSP..Capital.txt+X1949..JSP..Clothing.txt+X1949..JSP..Currency.txt+X1949..JSP..Food.txt+X1949..JSP..Prices.txt+X1949..JSP..Production.Increase.txt+X1949..JSP..Taxes.txt+X1949..JSP..Unemployment.txt
JSP.1949.Societal<-X1949..JSP..Housing.txt

LFP.1949.Economy<-X1949..LFP..Administrative.Organization.txt+X1949..LFP..Business.Organization.txt+X1949..LFP..Capital.txt+X1949..LFP..Clothing.txt+X1949..LFP..Currency.txt+X1949..LFP..Food.txt+X1949..LFP..Prices.txt+X1949..LFP..Production.Increase.txt+X1949..LFP..Taxes.txt+X1949..LFP..Unemployment.txt
LFP.1949.Societal<-X1949..LFP..Housing.txt


###### 1950 ELECTION #######

GP.1950.Economy<-X1950..GP..Administrative.Organization.txt+X1950..GP..Agriculture.txt+X1950..GP..Industry.txt+X1950..GP..Labor.txt+X1950..GP..Recession.txt+X1950..GP..Taxes.txt+X1950..GP..Trade.txt
GP.1950.Societal<-X1950..GP..Citizen.Living.Condition.txt+X1950..GP..Education.Policy.txt
GP.1950.Foreign<-X1950..GP..Peace.txt

JCP.1950.Economy<-X1950..JCP..Administrative.Reform.txt+X1950..JCP..Agriculture.txt+X1950..JCP..Industry.txt+X1950..JCP..Labor.txt+X1950..JCP..Recession.txt+X1950..JCP..Taxes.txt+X1950..JCP..Trade.txt
JCP.1950.Societal<-X1950..JCP..Citizen.Living.Condition.txt+X1950..JCP..Education.Policy.txt
JCP.1950.Foreign<-X1950..JCP..Peace.txt

JSP.1950.Economy<-X1950..JSP..Administrative.Reform.txt+X1950..JSP..Agriculture.txt+X1950..JSP..Industry.txt+X1950..JSP..Labor.txt+X1950..JSP..Recession.txt+X1950..JSP..Taxes.txt+X1950..JSP..Trade.txt
JSP.1950.Societal<-X1950..JSP..Citizen.Living.Condition.txt+X1950..JSP..education.Policy.txt
JSP.1950.Foreign<-X1950..JSP..Peace.txt

LP.1950.Economy<-X1950..LP..Administrative.Reform.txt+X1950..LP..Agriculture.txt+X1950..LP..Industry.txt+X1950..LP..Labor.txt+X1950..LP..Recession.txt+X1950..LP..Taxes.txt+X1950..LP..Trade.txt
LP.1950.Societal<-X1950..LP..Citizen.Living.Condition.txt+X1950..LP..Education.Policy.txt
LP.1950.Foreign<-X1950..LP..Peace.txt

NDP.1950.Economy<-X1950..NDP..Agriculture.txt+X1950..NDP..Industry.txt+X1950..NDP..Labor.txt+X1950..NDP..Recession.txt+X1950..NDP..Taxes.txt+X1950..NDP..Trade.txt
NDP.1950.Societal<-X1950..NDP..Citizen.Living.Condition.txt+X1950..NDP..Education.Policy.txt
NDP.1950.Foreign<-X1950..NDP..Peace.txt

###### 1952 ELECTION #######

CP.1952.Societal<-X1952..CP..Education.txt+X1952..CP..Living.Conditions.txt
CP.1952.Foreign<-X1952..CP..Defense.txt
CP.1952.Other<-X1952..CP..Basic.Principles.txt

JCP.1952.Economy<-X1952..JCP..Industry.txt
JCP.1952.Societal<-X1952..JCP..Education.txt+X1952..JCP..Living.Condition.txt
JCP.1952.Foreign<-X1952..JCP..Defense.txt
JCP.1952.Other<-X1952..JCP..Basic.Principles.txt

JSP.1952.Economy<-X1952..JSP..Industry.txt

LFP.1952.Economy<-X1952..LFP..Industry.txt
LFP.1952.Societal<-X1952..LFP..Education.txt+X1952..LFP..Living.Condition.txt
LFP.1952.Foreign<-X1952..LFP..Defense.txt
LFP.1952.Other<-X1952..LFP..Basic.Principles.txt

LP.1952.Economy<-X1952..LP..Industry.txt
LP.1952.Societal<-X1952..LP..Education.txt+X1952..LP..Living.Condition.txt
LP.1952.Foreign<-X1952..LP..Defense.txt
LP.1952.Other<-X1952..LP..Basic.Principles.txt

LSP.1952.Economy<-X1952..LSP..Industry.txt
LSP.1952.Societal<-X1952..LSP..Education.txt+X1952..LSP..Living.Condition.txt
LSP.1952.Foreign<-X1952..LSP..Defense.txt
LSP.1952.Other<-X1952..LSP..Basic.Principles.txt

RP.1952.Economy<-X1952..RP..Industry.txt
RP.1952.Societal<-X1952..RP..Education.txt+X1952..RP..Living.Condition.txt
RP.1952.Foreign<-X1952..RP..Defense.txt
RP.1952.Other<-X1952..RP..Basic.Principles.txt

RSP.1952.Economy<-X1952..RSP..Industry.txt
RSP.1952.Societal<-X1952..RSP..Education.txt+X1952..RSP..Living.Condition.txt
RSP.1952.Foreign<-X1952..RSP..defense.txt
RSP.1952.Other<-X1952..RSP..Basic.Principles.txt

###### 1953 ELECTION #######

GP.1953.Economy<-X1953..GP..Rice.Price.txt+X1953..GP..Small.Business.txt+X1953..GP..Special.Procurement.txt+X1953..GP..Strikes.txt+X1953..GP..Taxes.txt
GP.1953.Foreign<-X1953..GP..Security.Forces.txt

JCP.1953.Economy<-X1953..JCP..Rice.Price.txt+X1953..JCP..Small.Business.txt+X1953..JCP..Special.Procurement.txt+X1953..JCP..Strikes.txt+X1953..JCP..Taxes.txt
JCP.1953.Foreign<-X1953..JCP..Security.Forces.txt

LBP.1953.Economy<-X1953..LBP..Rice.Price.txt+X1953..LBP..Small.Business.txt+X1953..LBP..Special.Procurement.txt+X1953..LBP..Strikes.txt+X1953..LBP..Taxes.txt
LBP.1953.Foreign<-X1953..LBP..Security.Forces.txt

LFP.1953.Economy<-X1953..LFP..Rice.Price.txt+X1953..LFP..Small.Business.txt+X1953..LFP..Special.Procurement.txt+X1953..LFP..Strikes.txt+X1953..LFP..Taxes.txt
LFP.1953.Foreign<-X1953..LFP..Security.Procurement.txt

LP.1953.Economy<-X1953..LP..Rice.Price.txt+X1953..LP..Small.Business.txt+X1953..LP..Special.Procurement.txt+X1953..LP..Strikes.txt+X1953..LP..Taxes.txt
LP.1953.Foreign<-X1953..LP..Security.Forces.txt

LSP.1953.Economy<-X1953..LSP..Rice.Price.txt+X1953..LSP..Small.Business.txt+X1953..LSP..Special.Procurement.txt+X1953..LSP..Strikes.txt+X1953..LSP..Taxes.txt
LSP.1953.Foreign<-X1953..LSP..Security.Forces.txt

RP.1953.Economy<-X1953..RP..Rice.Price.txt+X1953..RP..Small.Business.txt+X1953..RP..Special.Procurement.txt+X1953..RP..Strikes.txt+X1953..RP..Taxes.txt
RP.1953.Foreign<-X1953..RP..Security.Forces.txt

RSP.1953.Economy<-X1953..RSP..Rice.Price.txt+X1953..RSP..Small.Business.txt+X1953..RSP..Special.Procurement.txt+X1953..RSP..Strikes.txt+X1953..RSP..Taxes.txt
RSP.1953.Foreign<-X1953..RSP..Security.Forces.txt

### Left out categories in 1953:
### X1953..GP..Policy.txt
### X1953..JCP..Policy.txt
### X1953..LBP..Policy.txt
### X1953..LFP..Policy.txt
### X1953..LP..Policy.txt
### X1953..LSP..Policy.txt
### X1953..RP..Policy.txt
### X1953..RSP..Policy.txt


###### 1955 ELECTION #######

DP.1955.Economy<-X1955..DP..Economic.Independence.txt+X1955..DP..Staple.Diet.txt+X1955..DP..Taxes.txt+X1955..DP..Unemployment.txt
DP.1955.Foreign<-X1955..DP..Self.Defense.Forces.txt+X1955..DP..Trade.with.China.and.USSR.txt
DP.1955.Societal<-X1955..DP..Housing.txt

JCP.1955.Economy<-X1955..JCP..Economic.Independence.txt+X1955..JCP..Staple.Diet.txt+X1955..JCP..Taxes.txt+X1955..JCP..Unemployment.txt
JCP.1955.Foreign<-X1955..JCP..Self.Defenses.Forces.txt+X1955..JCP..Trade.with.China.and.USSR.txt
JCP.1955.Societal<-X1955..JCP..Housing.txt

LFP.1955.Economy<-X1955..LFP..Economic.Independence.txt+X1955..LFP..Staple.Diet.txt+X1955..LFP..Taxes.txt+X1955..LFP..Unemployment.txt
LFP.1955.Foreign<-X1955..LFP..Self.Defense.Forces.txt+X1955..LFP..Trade.with.China.and.USSR.txt
LFP.1955.Societal<-X1955..LFP..Housing.txt

LP.1955.Economy<-X1955..LP..Economic.Independence.txt+X1955..LP..Staple.Diet.txt+X1955..LP..Taxes.txt+X1955..LP..Unemployment.txt
LP.1955.Foreign<-X1955..LP..Self.Defense.Forces.txt+X1955..LP..Trade.with.China.and.USSR.txt
LP.1955.Societal<-X1955..LP..Housing.txt

LSP.1955.Economy<-X1955..LSP..Economic.Independence.txt+X1955..LSP..Staple.Diet.txt+X1955..LSP..Taxes.txt+X1955..LSP..Unemployment.txt
LSP.1955.Foreign<-X1955..LSP..Trade.with.China.and.USSR.txt+X1955..LSP..Self.Defense.Forces.txt
LSP.1955.Societal<-X1955..LSP..Housing.txt

RSP.1955.Economy<-X1955..RSP..Economic.Independence.txt+X1955..RSP..Staple.Diet.txt+X1955..RSP..Taxes.txt+X1955..RSP..Unemployment.txt
RSP.1955.Foreign<-X1955..RSP..Trade.with.China.and.USSR.txt+X1955..RSP..Self.Defense.Forces.txt
RSP.1955.Societal<-X1955..RSP..Housing.txt


### Excluded issues in 1955:
### X1955..DP..Policy.from.All.Issues.txt
### X1955..JCP..Policy.from.All.Issues.txt
### X1955..LFP..Policy.from.All.Issues.txt
### X1955..LP..Policy.from.All.Issues.txt
### X1955..LSP..Policy.from.All.Issues.txt
### X1955..RSP..Policy.from.All.Issues.txt


###### 1956 ELECTION #######

GP.1956.DomesticPolitics<-X1956..GP..Constitutional.Reform.txt+X1956..GP..Government.Ethics.Enforcement.txt
GP.1956.Foreign<-X1956..GP..Japan.USSR.Negotiations.txt
GP.1956.Societal<-X1956..GP..Education.txt

JCP.1956.DomesticPolitics<-X1956..JCP..Constitutional.Reform.txt+X1956..JCP..Gevernment.Ethics.Enforcement.txt
JCP.1956.Foreign<-X1956..JCP..Japan.USSR.Negotiation.txt
JCP.1956.Societal<-X1956..JCP..Education.txt

JSP.1956.DomesticPolitics<-X1956..JSP..Constitutional.Reform.txt+X1956..JSP..Government.ethics.Enforcement.txt
JSP.1956.Foreign<-X1956..JSP..Japan.USSR.Negotiation.txt
JSP.1956.Societal<-X1956..JSP..Education.txt

LDP.1956.DomesticPolitics<-X1956..LDP..Constitutional.Reform.txt+X1956..LDP..Government.Ethics.Enforcement.txt
LDP.1956.Foreign<-X1956..LDP..Japan.USSR.Negotiation.txt
LDP.1956.Societal<-X1956..LDP..Education.txt

LFP.1956.DomesticPolitics<-X1956..LFP..Constitutional.Reform.txt+X1956..LFP..Government.Ethics.Enforcement.txt
LFP.1956.Foreign<-X1956..LFP..Japan.USSR.Negotiation.txt
LFP.1956.Societal<-X1956..LFP..Education.txt

### Excluded issues in 1956:
### X1956..GP..Fundamental.Policy.txt
### X1956..JCP..Fundamental.Policy.txt
### X1956..JSP..Fundamental.Policy.txt
### X1956..LDP..Fundamental.Policy.txt
### X1956..LFP..Fundamental.Policy.txt


###### 1958 ELECTION #######

JCP.1958.DomesticPolitics<-X1958..JCP..Political.Institutions.txt
JCP.1958.Economy<-X1958..JCP..Industry...Land.Use.txt+X1958..JCP..Recession.txt
JCP.1958.Foreign<-X1958..JCP..Foreign.Policy.txt+X1958..JCP..Peace...Security.txt
JCP.1958.Societal<-X1958..JCP..Education.txt+X1958..JCP..Living.Condition.txt+X1958..JCP..Social.Security...Labor.Conditions.txt

JSP.1958.DomesticPolitics<-X1958..JSP..Political.Institutions.txt
JSP.1958.Economy<-X1958..JSP..Industry...Land.Use.txt+X1958..JSP..Recession.txt
JSP.1958.Foreign<-X1958..JSP..Foreign.Policy.txt+X1958..JSP..Peace...Security.txt
JSP.1958.Societal<-X1958..JSP..Education.txt+X1958..JSP..Living.Condition.txt+X1958..JSP..Social.Security...Labor.Conditions.txt

LDP.1958.DomesticPolitics<-X1958..LDP..Political.Institutions.txt
LDP.1958.Economy<-X1958..LDP..Industry...Land.Use.txt+X1958..LDP..Recession.txt
LDP.1958.Foreign<-X1958..LDP..Foreign.Policy.txt+X1958..LDP..Peace...Security.txt
LDP.1958.Societal<-X1958..LDP..Education.txt+X1958..LDP..Living.Conditions.txt+X1958..LDP..Social.Security...Labor.Conditions.txt

###### 1960 ELECTION #######

DSP.1960.DomesticPolitics<-X1960..DSP..Rebuilding.Democratic.Politics.txt
DSP.1960.Economy<-X1960..DSP..Industry.txt+X1960..DSP..Long.term.Economic.Planning.txt
DSP.1960.Foreign<-X1960..DSP..Foregn.Policy.txt+X1960..DSP..Security.Treaty.txt
DSP.1960.Societal<-X1960..DSP..Citizen.Living.Conditions.txt+X1960..DSP..Education.txt+X1960..DSP..Social.Security...Labor.Conditions.txt

JCP.1960.DomesticPolitics<-X1960..JCP..Rebuilding.Democratic.Politics.txt
JCP.1960.Economy<-X1960..JCP..Industry.txt+X1960..JCP..Long.term.Economic.Planning.txt
JCP.1960.Foreign<-X1960..JCP..Foreign.Policy.txt+X1960..JCP..Security.Treaty.txt
JCP.1960.Societal<-X1960..JCP..Citizen.Living.Conditions.txt+X1960..JCP..Education.txt+X1960..JCP..Social.Security...Labor.Conditions.txt

JSP.1960.DomesticPolitics<-X1960..JSP..Rebuilding.Democratic.Politics.txt
JSP.1960.Economy<-X1960..JSP..Industry.txt+X1960..JSP..Long.term.Economic.Planning.txt
JSP.1960.Foreign<-X1960..JSP..Foreign.Policy.txt
# NOTE: no security treaty category for JSP in 1960
JSP.1960.Societal<-X1960..JSP..Citizen.Living.Conditions.txt+X1960..JSP..Education.txt+X1960..JSP..Social.Security...Labor.Conditions.txt

LDP.1960.DomesticPolitics<-X1960..LDP..Rebuilding.Democratic.Politics.txt
LDP.1960.Economy<-X1960..LDP..Industry.txt+X1960..LDP..Long.term.Economic.Planning.txt
LDP.1960.Foreign<-X1960..LDP..Foreign.Policy.txt+X1960..LDP..Security.Treaty.txt
LDP.1960.Societal<-X1960..LDP..Citizen.Living.Conditions.txt+X1960..LDP..Education.txt+X1960..LDP..Social.Security...Labor.Conditions.txt


###### 1962 ELECTION #######

DSP.1962.DomesticPolitics<-X1962..DSP..Constitution.txt+X1962..DSP..Establishment.of.Democrtic.Politics.txt
DSP.1962.Economy<-X1962..DSP..Economy.txt
DSP.1962.Foreign<-X1962..DSP..Foreign.Policy.txt
DSP.1962.Societal<-X1962..DSP..Citizen.Living.Condition.txt+X1962..DSP..Education.txt

JCP.1962.DomesticPolitics<-X1962..JCP..Constitution.txt+X1962..JCP..Establishment.of.Democratic.Politics.txt
JCP.1962.Economy<-X1962..JCP..Economy.txt
JCP.1962.Foreign<-X1962..JCP..Foreign.Policy.txt
JCP.1962.Societal<-X1962..JCP..Citizen.Living.Condition.txt+X1962..JCP..Education.txt

JSP.1962.DomesticPolitics<-X1962..JSP..Constitution.txt+X1962..JSP..Establishment.of.Democratic.Politics.txt
JSP.1962.Economy<-X1962..JSP..Economy.txt
JSP.1962.Foreign<-X1962..JSP..Foreign.Policy.txt
JSP.1962.Societal<-X1962..JSP..Citizen.Living.Condition.txt+X1962..JSP..Education.txt

LDP.1962.DomesticPolitics<-X1962..LDP..Constitution.txt+X1962..LDP..Establishment.of.Democratic.Politics.txt
LDP.1962.Economy<-X1962..LDP..Economy.txt
LDP.1962.Foreign<-X1962..LDP..Foreign.Policy.txt
LDP.1962.Societal<-X1962..LDP..Citizen.Living.Condition.txt+X1962..LDP..Education.txt

LFG.1962.DomesticPolitics<-X1962..LFG..Constitution.txt+X1962..LFG..Establishment.of.Democratic.Politics.txt
LFG.1962.Economy<-X1962..LFG..Economy.txt
LFG.1962.Foreign<-X1962..LFG..Foreign.Policy.txt
LFG.1962.Societal<-X1962..LFG..Citizen.Living.Condition.txt+X1962..LFG..Education.txt

###### 1963 ELECTION #######

DSP.1963.DomesticPolitics<-X1963..DSP..Constitution...Defense.txt
DSP.1963.Economy<-X1963..DSP..Industry...Trade.txt+X1963..DSP..Price...Salary.txt+X1963..DSP..Price.txt
DSP.1963.Foreign<-X1963..DSP..Diplomacy.txt
DSP.1963.Societal<-X1963..DSP..Education.txt+X1963..DSP..Society.txt

JCP.1963.DomesticPolitics<-X1963..JCP..Constitution...Defense.txt
JCP.1963.Economy<-X1963..JCP..Price...Salary.txt+X1963..JCP..Price.txt
JCP.1963.Foreign<-X1963..JCP..Diplomacy.txt
JCP.1963.Societal<-X1963..JCP..Education.txt+X1963..JCP..Society.txt

JSP.1963.DomesticPolitics<-X1963..JSP..Constitution...Defense.txt
JSP.1963.Economy<-X1963..JSP..Industry...Trade.txt+X1963..JSP..Price...Salary.txt
JSP.1963.Foreign<-X1963..JSP..Diplomacy.txt
JSP.1963.Societal<-X1963..JSP..Education.txt+X1963..JSP..Society.txt

LDP.1963.DomesticPolitics<-X1963..LDP..Constitution...Defense.txt
LDP.1963.Economy<-X1963..LDP..Industry...Trade.txt+X1963..LDP..Price...Salary.txt
LDP.1963.Foreign<-X1963..LDP..Diplomacy.txt
LDP.1963.Societal<-X1963..LDP..Education.txt+X1963..LDP..Society.txt

### Excluded issues in 1963:
### X1963..DSP..National.Land.Construction.txt
### X1963..DSP..National.Life.txt
### X1963..JCP..National.Land.Construction.txt
### X1963..JCP..National.Life.txt
### X1963..JSP..National.Land.Construction.txt
### X1963..JSP..National.Life.txt
### X1963..LDP..National.Land.Construction.txt
### X1963..LDP..National.Life.txt


###### 1965 ELECTION #######

CGP.1965.DomesticPolitics<-X1965..CGP..Constitution.txt+X1965..CGP..Establishment.of.Democratic.Politics.txt
CGP.1965.Economy<-X1965..CGP..Economy.txt+X1965..CGP..Labor.txt
CGP.1965.Foreign<-X1965..CGP..Foreign.Policy.txt
CGP.1965.Societal<-X1965..CGP..Citizen.Living.Condition.txt

DSP.1965.DomesticPolitics<-X1965..DSP..Constitution.txt+X1965..DSP..Establishment.of.Democratic.Politics.txt
DSP.1965.Economy<-X1965..DSP..Economy.txt+X1965..DSP..Labor.txt
DSP.1965.Foreign<-X1965..DSP..Foreign.Policy.txt
DSP.1965.Societal<-X1965..DSP..Citizen.Living.Condition.txt

JCP.1965.DomesticPolitics<-X1965..JCP..Constitution.txt+X1965..JCP..Establishment.of.Democratic.Politics.txt
JCP.1965.Economy<-X1965..JCP..Economy.txt+X1965..JCP..Labor.txt
JCP.1965.Foreign<-X1965..JCP..Foreign.Policy.txt
JCP.1965.Societal<-X1965..JCP..Citizen.Living.Condition.txt

JSP.1965.DomesticPolitics<-X1965..JSP..Constitution.txt+X1965..JSP..Establishment.of.Democratic.Politics.txt
JSP.1965.Economy<-X1965..JSP..Economy.txt+X1965..JSP..Labor.txt
JSP.1965.Foreign<-X1965..JSP..Foreign.Policy.txt
JSP.1965.Societal<-X1965..JSP..Citizen.Living.Condition.txt

LDP.1965.DomesticPolitics<-X1965..LDP..Constitution.txt+X1965..LDP..Establishment.of.Democratic.Politics.txt
LDP.1965.Economy<-X1965..LDP..Economy.txt+X1965..LDP..Labor.txt
LDP.1965.Foreign<-X1965..LDP..Foreign.Policy.txt
LDP.1965.Societal<-X1965..LDP..Citizen.Living.Condition.txt


###### 1967 ELECTION #######

CGP.1967.Economy<-X1967..CGP..Economy.txt+X1967..CGP..Finance.txt+X1967..CGP..Labor.txt+X1967..CGP..Prices.txt
CGP.1967.Foreign<-X1967..CGP..Foreign.Policy...Defense.txt
CGP.1967.Societal<-X1967..CGP..Education.txt+X1967..CGP..Social.Security.txt+X1967..CGP..Urban.Problems.txt

DSP.1967.Economy<-X1967..DSP..Economy.txt+X1967..DSP..Finance.txt+X1967..DSP..Labor.txt+X1967..DSP..Prices.txt
DSP.1967.Foreign<-X1967..DSP..Foreign.Policy..Defense.txt
DSP.1967.Societal<-X1967..DSP..Education.txt+X1967..DSP..Social.Security.txt+X1967..DSP..Urban.Problems.txt

JCP.1967.Economy<-X1967..JCP..Economy.txt+X1967..JCP..Finance.txt+X1967..JCP..Labor.txt+X1967..JCP..Prices.txt
JCP.1967.Foreign<-X1967..JCP..Foreign.Policy..Defense.txt
JCP.1967.Societal<-X1967..JCP..Education.txt+X1967..JCP..Social.Security.txt+X1967..JCP..Urban.Problems.txt

JSP.1967.Economy<-X1967..JSP..Economy.txt+X1967..JSP..Finance.txt+X1967..JSP..Labor.txt+X1967..JSP..Prices.txt
JSP.1967.Foreign<-X1967..JSP..Foreign.Policy...Defense.txt
JSP.1967.Societal<-X1967..JSP..Education.txt+X1967..JSP..Social.security.txt+X1967..JSP..Urban.Problems.txt

LDP.1967.Economy<-X1967..LDP..Economy.txt+X1967..LDP..Finance.txt+X1967..LDP..Labor.txt+X1967..LDP..Prices.txt
LDP.1967.Foreign<-X1967..LDP..Foreign.Policy...Defense.txt
LDP.1967.Societal<-X1967..LDP..Education.txt+X1967..LDP..Social.Security.txt+X1967..LDP..Urban.Problems.txt


###### 1968 ELECTION #######

CGP.1968.DomesticPolitics<-X1968..CGP..Political.Principles.txt
CGP.1968.Economy<-X1968..CGP..Economy.txt+X1968..CGP..Land...Housing.txt
CGP.1968.Foreign<-X1968..CGP..Foreign.Policy.txt+X1968..CGP..Okinawa.Return.txt+X1968..CGP..Security.Treaty.txt
CGP.1968.Societal<-X1968..CGP..Education.txt

DSP.1968.DomesticPolitics<-X1968..DSP..Political.Principles.txt
DSP.1968.Economy<-X1968..DSP..Economy.txt+X1968..DSP..Land...Housing.txt
DSP.1968.Foreign<-X1968..DSP..Foreign.Policy.txt+X1968..DSP..Okinawa.Return.txt+X1968..DSP..Security.Treaty.txt
DSP.1968.Societal<-X1968..DSP..Education.txt

JCP.1968.DomesticPolitics<-X1968..JCP..Political.Principles.txt
JCP.1968.Economy<-X1968..JCP..Economy.txt+X1968..JCP..Land...Housing.txt
JCP.1968.Foreign<-X1968..JCP..Foreign.Policy.txt+X1968..JCP..Okinawa.Return.txt+X1968..JCP..Security.Treaty.txt
JCP.1968.Societal<-X1968..JCP..Education.txt

JSP.1968.DomesticPolitics<-X1968..JSP..Political.Principles.txt
JSP.1968.Economy<-X1968..JSP..Economy.txt+X1968..JSP..Land...Housing.txt
JSP.1968.Foreign<-X1968..JSP..Foreign.Policy.txt+X1968..JSP..Okinawa.Return.txt+X1968..JSP..Security.Treaty.txt
JSP.1968.Societal<-X1968..JSP..Education.txt

LDP.1968.DomesticPolitics<-X1968..LDP..Political.Principles.txt
LDP.1968.Economy<-X1968..LDP..Economy.txt+X1968..LDP..Land...Housing.txt
LDP.1968.Foreign<-X1968..LDP..Foreign.Policy.txt+X1968..LDP..Okinawa.Return.txt+X1968..LDP..Security.Treaty.txt
LDP.1968.Societal<-X1968..LDP..Education.txt


###### 1969 ELECTION #######

CGP.1969.DomesticPolitics<-X1969..CGP..Parliamentary.Politics.txt
CGP.1969.Economy<-X1969..CGP..Rice.Production.txt+X1969..CGP..Tax.Reduction...Prices.txt
CGP.1969.Foreign<-X1969..CGP..Security...Okinawa.txt
CGP.1969.Societal<-X1969..CGP..Universities.txt

DSP.1969.DomesticPolitics<-X1969..DSP..Parliamentary.Politics.txt
DSP.1969.Economy<-X1969..DSP..Rice.Production.txt+X1969..DSP..Tax.Reduction...Prices.txt
DSP.1969.Foreign<-X1969..DSP..Security...Okinawa.txt
DSP.1969.Societal<-X1969..DSP..Universities.txt

JCP.1969.DomesticPolitics<-X1969..JCP..Parliamentary.Politics.txt
JCP.1969.Economy<-X1969..JCP..Rice.Production.txt+X1969..JCP..Tax.Reduction...Prices.txt
JCP.1969.Foreign<-X1969..JCP..Security.Treaty...Okinawa.txt
JCP.1969.Societal<-X1969..JCP..Universities.txt

JSP.1969.DomesticPolitics<-X1969..JSP..Parliamentary.Politics.txt
JSP.1969.Economy<-X1969..JSP..Rice.Production.txt+X1969..JSP..Tax.Reduction...Prices.txt
JSP.1969.Foreign<-X1969..JSP..Security.Treaty...Okinawa.txt
JSP.1969.Societal<-X1969..JSP..Universities.txt

LDP.1969.DomesticPolitics<-X1969..LDP..Parliamentary.Politics.txt
LDP.1969.Economy<-X1969..LDP..Rice.production.txt+X1969..LDP..Tax.Reduction...Prices.txt
LDP.1969.Foreign<-X1969..LDP..Security.Treaty...Okinawa.txt
LDP.1969.Societal<-X1969..LDP..Universities.txt


###### 1971 ELECTION #######

CGP.1971.Economy<-X1971..CGP..Agriculture.Policies.txt+X1971..CGP..Prices.txt
CGP.1971.Foreign<-X1971..CGP..Defense.txt+X1971..CGP..Japan.China.Relations.txt+X1971..CGP..Okinawa.txt
CGP.1971.Societal<-X1971..CGP..Pollution.txt+X1971..CGP..Urbanization.txt

DSP.1971.Economy<-X1971..DSP..Agriculture.Policies.txt+X1971..DSP..Prices.txt
DSP.1971.Foreign<-X1971..DSP..Defense.txt+X1971..DSP..Japan.China.Relations.txt+X1971..DSP..Okinawa.txt
DSP.1971.Societal<-X1971..DSP..Pollution.txt+X1971..DSP..Urbanization.txt

JCP.1971.Economy<-X1971..JCP..Agriculture.Policies.txt+X1971..JCP..Prices.txt
JCP.1971.Foreign<-X1971..JCP..Defense.txt+X1971..JCP..Japan.China.Relations.txt+X1971..JCP..Okinawa.txt
JCP.1971.Societal<-X1971..JCP..Pollution.txt+X1971..JCP..Urbanization.txt

JSP.1971.Economy<-X1971..JSP..Agriculture.Policies.txt+X1971..JSP..Prices.txt
JSP.1971.Foreign<-X1971..JSP..Defense.txt+X1971..JSP..Japan.China.Relations.txt+X1971..JSP..Okinawa.txt
JSP.1971.Societal<-X1971..JSP..Pollution.txt+X1971..JSP..Urbanization.txt

LDP.1971.Economy<-X1971..LDP..Agriculture.Policies.txt+X1971..LDP..Prices.txt
LDP.1971.Foreign<-X1971..LDP..Defense.txt+X1971..LDP..Japan.China.Relations.txt+X1971..LDP..Okinawa.txt
LDP.1971.Societal<-X1971..LDP..Pollution.txt+X1971..LDP..Urbanization.txt


###### 1972 ELECTION #######


CGP.1972.DomesticPolitics<-X1972..CGP..Political.Principles.txt
CGP.1972.Economy<-X1972..CGP..Land.Reconstruction.txt
CGP.1972.Foreign<-X1972.CGP..Foreign.Policy...Defense.txt
CGP.1972.Societal<-X1972..CGP..Citizen.Living.Condition.txt+X1972..CGP..Social.Welfare.txt

DSP.1972.DomesticPolitics<-X1972..DSP..Political.Principles.txt
DSP.1972.Economy<-X1972..DSP..Land.Reconstruction.txt
DSP.1972.Foreign<-X1972..DSP..Foreign.Policy...Defense.txt
DSP.1972.Societal<-X1972..DSP..Citizen.Living.Condition.txt+X1972..DSP..Social.Welfare.txt

JCP.1972.DomesticPolitics<-X1972..JCP..Political.Principles.txt
JCP.1972.Economy<-X1972..JCP..Land.Reconstruction.txt
JCP.1972.Foreign<-X1972..JCP..Foreign.Policy...Defense.txt
JCP.1972.Societal<-X1972..JCP..Citizen.Living.Condition.txt+X1972..JCP..Social.Welfare.txt

JSP.1972.DomesticPolitics<-X1972..JSP..Political.Principles.txt
JSP.1972.Economy<-X1972..JSP..Land.Reconstruction.txt
JSP.1972.Foreign<-X1972..JSP..Foreign.Policy...Defense.txt
JSP.1972.Societal<-X1972..JSP..Citizen.Living.Condition.txt+X1972..JSP..Social.Welfare.txt

LDP.1972.DomesticPolitics<-X1972..LDP..Political.Principles.txt
LDP.1972.Economy<-X1972..LDP..Land.Reconstruction.txt
LDP.1972.Foreign<-X1972..LDP..Foreign.Policy...Defense.txt
LDP.1972.Societal<-X1972..LDP..Citizen.Living.Condition.txt+X1972..LDP..Social.Welfare.txt


###### 1976 ELECTION #######

CGP.1976.DomesticPolitics<-X1976..CGP..Demestic.Politics.txt+X1976..CGP..Electoral.System.txt+X1976..CGP..Political.Cleansing.txt
CGP.1976.Foreign<-X1976..CGP..Foreign.Policy...Defense.txt

DSP.1976.DomesticPolitics<-X1976..DSP..Domestic.Politics.txt+X1976..DSP..Electoral.System.txt+X1976..DSP..Political.Cleansing.txt
DSP.1976.Foreign<-X1976..DSP..Foreign.Policy...Defense.txt

JCP.1976.DomesticPolitics<-X1976..JCP..Domestic.Politics.txt+X1976..JCP..Electoral.System.txt+X1976..JCP..Political.Cleansing.txt
JCP.1976.Foreign<-X1976..JCP..Foreign.Policy...Defense.txt

JSP.1976.DomesticPolitics<-X1976..JSP..Domestic.Politics.txt+X1976..JSP..Electoral.System.txt+X1976..JSP..Political.Cleansing.txt
JSP.1976.Foreign<-X1976..JSP..Foreign.Policy...Defense.txt

LDP.1976.DomesticPolitics<-X1976..LDP..Electoral.system.txt+X1976..LDP..Domestic.Politics.txt+X1976..LDP..Political.Cleansing.txt
LDP.1976.Foreign<-X1976..LDP..Foreign.Policy...Defense.txt

NLC.1976.DomesticPolitics<-X1976..NLC..Domestic.Politics.txt+X1976..NLC..Electoral.System.txt+X1976..NLC..political.Cleansing.txt
NLC.1976.Foreign<-X1976..NLC..Foreign.Politics...Defense.txt


###### 1977 ELECTION #######
#### Note: Education is under Societal (not economy)


CGP.1977.DomesticPolitics<-X1977..CGP..Political.Power...Politics.txt
CGP.1977.Economy<-X1977..CGP..Food...Energy.txt+X1977..CGP..Pensions...Tax.System.txt+X1977..CGP..Prices.txt
CGP.1977.Foreign<-X1977..CGP..Foreign.Policy...Defense.txt
CGP.1977.Societal<-X1977..CGP..Education.txt

DSP.1977.DomesticPolitics<-X1977..DSP..Political.Power...politics.txt
DSP.1977.Economy<-X1977..DSP..Food...Energy.txt+X1977..DSP..Pensions...Tax.System.txt+X1977..DSP..Prices.txt
DSP.1977.Foreign<-X1977..DSP..Foreign.Policy...Defense.txt
DSP.1977.Societal<-X1977..DSP..Education.txt

JCP.1977.DomesticPolitics<-X1977..JCP..Political.Power...Politics.txt
JCP.1977.Economy<-X1977..JCP..Food...Energy.txt+X1977..JCP..Pensions...Tax.System.txt+X1977..JCP..Prices.txt
JCP.1977.Foreign<-X1977..JCP..Foreign.Policy...Defense.txt
JCP.1977.Societal<-X1977..JCP..Education.txt

JSP.1977.DomesticPolitics<-X1977..JSP..Political.Power...Politics.txt
JSP.1977.Economy<-X1977..JSP..Food...Energy.txt+X1977..JSP..Pensions...Tax.System.txt+X1977..JSP..Prices.txt
JSP.1977.Foreign<-X1977..JSP..Foreign.Policy...Defense.txt
JSP.1977.Societal<-X1977..JSP..Education.txt

LDP.1977.DomesticPolitics<-X1977..LDP..Political.Power...Politics.txt
LDP.1977.Economy<-X1977..LDP..Food...Energy.txt+X1977..LDP..Pensions...Tax.System.txt+X1977..LDP..Prices.txt
LDP.1977.Foreign<-X1977..LDP..Foreign.Policy...Defense.txt
LDP.1977.Societal<-X1977..LDP..Education.txt

NLC.1977.DomesticPolitics<-X1977..NLC..Political.Power...Politics.txt
NLC.1977.Economy<-X1977..NLC..Food...Energy.txt+X1977..NLC..Pensions...Tax.System.txt+X1977..NLC..Prices.txt
NLC.1977.Foreign<-X1977..NLC..Foreign.Policy...Defense.txt
NLC.1977.Societal<-X1977..NLC..Education.txt

### Not included in 1977:
### X1977..RLA..E.T.C.txt
### X1977..SCA..E.T.C.txt


###### 1979 ELECTION #######
#### Note: no political cleansing category, but political corruption (under domestic politics)


CGP.1979.DomesticPolitics<-X1979..CGP..Correct.Political.Corruption.txt
CGP.1979.Economy<-X1979..CGP..Inflation...Energy.txt+X1979..CGP..Tax.Increase.txt
CGP.1979.Foreign<-X1979..CGP..Foreign.Policy...Defense.txt
CGP.1979.Societal<-X1979..CGP..Education.txt+X1979..CGP..Welfare...Responsibility.txt

DSP.1979.DomesticPolitics<-X1979..DSP..Correct.Political.Corruption.txt
DSP.1979.Economy<-X1979..DSP..Inflation...Energy.txt+X1979..DSP..Tax.Increase.txt
DSP.1979.Foreign<-X1979..DSP..Foreign.Policy...Defense.txt
DSP.1979.Societal<-X1979..DSP..Education.txt+X1979..DSP..Welfare...Responsibility.txt

JCP.1979.DomesticPolitics<-X1979..JCP..Correct.Political.Corruption.txt
JCP.1979.Economy<-X1979..JCP..Inflation...Energy.txt+X1979..JCP..Tax.Increase.txt
JCP.1979.Foreign<-X1979..JCP..Foreign.Policy...Defense.txt
JCP.1979.Societal<-X1979..JCP..Education.txt+X1979..JCP..Welfare...Responsibility.txt

JSP.1979.DomesticPolitics<-X1979..JSP..Correct.Political.Corruption.txt
JSP.1979.Economy<-X1979..JSP..Inflation...Energy.txt+X1979..JSP..Tax.Increase.txt
JSP.1979.Foreign<-X1979..JSP..Foreign.Policy...Defense.txt
JSP.1979.Societal<-X1979..JSP..Education.txt+X1979..JSP..Welfare...Responsibility.txt

LDP.1979.DomesticPolitics<-X1979..LDP..Correct.Political.Corruption.txt
LDP.1979.Economy<-X1979..LDP..Inflation...Energy.txt+X1979..LDP..Tax.Increase.txt
LDP.1979.Foreign<-X1979..LDP..Foreign.Policy...Defense.txt
LDP.1979.Societal<-X1979..LDP..Education.txt+X1979..LDP..Welfare...Responsibility.txt

NLC.1979.DomesticPolitics<-X1979..NLC..Correct.Political.Corruption.txt
NLC.1979.Economy<-X1979..NLC..Inflation...Energy.txt+X1979..NLC..Tax.Increase.txt
NLC.1979.Foreign<-X1979..NLC..Foreign.Policy...Defense.txt
NLC.1979.Societal<-X1979..NLC..Education.txt+X1979..NLC..Welfare...Responsibility.txt

REN.1979.DomesticPolitics<-X1979..REN..Correct.Political.Corruption.txt
REN.1979.Economy<-X1979..REN..Inflation...Energy.txt+X1979..REN..Tax.Increase.txt
REN.1979.Foreign<-X1979..REN..Foreign.Policy...Defense.txt
REN.1979.Societal<-X1979..REN..Education.txt+X1979..REN..Welfare...Responsibility.txt


###### 1980 ELECTION #######

CGP.1980.DomesticPolitics<-X1980..CGP..Political.Cleansing.txt
CGP.1980.Economy<-X1980..CGP..Administrative.Reform.txt+X1980..CGP..Energy.txt+X1980..CGP..Prices.and.Inflation.txt
CGP.1980.Foreign<-X1980..CGP..Security...Defense.txt
CGP.1980.Societal<-X1980..CGP..Education.txt+X1980..CGP..Welfare.txt

DSP.1980.DomesticPolitics<-X1980..DSP..Political.Cleansing.txt
DSP.1980.Economy<-X1980..DSP..Administrative.Reform.txt+X1980..DSP..Energy.txt+X1980..DSP..Prices...Inflation.txt
DSP.1980.Foreign<-X1980..DSP..Security...Defense.txt
DSP.1980.Societal<-X1980..DSP..Education.txt+X1980..DSP..Welfare.txt

JCP.1980.DomesticPolitics<-X1980..JCP..Political.Cleansing.txt
JCP.1980.Economy<-X1980..JCP..Administrative.Reform.txt+X1980..JCP..Energy.txt+X1980..JCP..Prices...Inflation.txt
JCP.1980.Foreign<-X1980..JCP..Security...Defense.txt
JCP.1980.Societal<-X1980..JCP..Welfare.txt+X1980..JCP..Education.txt

JSP.1980.DomesticPolitics<-X1980..JSP..Political.Cleansing.txt
JSP.1980.Economy<-X1980..JSP...Prices...Inflation.txt+X1980..JSP..Administrative.Reform.txt+X1980..JSP..Energy.txt
JSP.1980.Foreign<-X1980..JSP...Security...Defense.txt
JSP.1980.Societal<-X1980..JSP..Education.txt+X1980..JSP..Welfare.txt

LDP.1980.DomesticPolitics<-X1980..LDP..Political.Cleansing.txt
LDP.1980.Economy<-X1980..LDP...Prices...Inflation.txt+X1980..LDP..Administrative.Reform.txt+X1980..LDP..Energy.txt
LDP.1980.Foreign<-X1980..LDP...Security...Defense.txt
LDP.1980.Societal<-X1980..LDP..Education.txt+X1980..LDP..Welfare.txt

NLC.1980.DomesticPolitics<-X1980..NLC..political.Cleansing.txt
NLC.1980.Economy<-X1980..NLC...Prices...Inflation.txt+X1980..NLC..Administrative.Reform.txt+X1980..NLC..Energy.txt
NLC.1980.Foreign<-X1980..NLC..Security...Defense.txt
NLC.1980.Societal<-X1980..NLC..Welfare.txt+X1980..NLC..Education.txt

REN.1980.DomesticPolitics<-X1980..REN..Political.Cleansing.txt
REN.1980.Economy<-X1980..REN...Prices...Inflation.txt+X1980..REN..Administrative.Reform.txt+X1980..REN..Energy.txt
REN.1980.Foreign<-X1980..REN..Security...Defense.txt
REN.1980.Societal<-X1980..REN..Education.txt+X1980..REN..Welfare.txt


###### 1983 ELECTION #######

CGP.1983.DomesticPolitics<-X1983..CGP..Constitution.txt+X1983..CGP..Political.Ethics.txt
CGP.1983.Economy<-X1983..CGP..Tax.Reduction...Economy.txt+X1983..CGP..Administrative...Financial.Reform.txt+X1983..CGP..Market.Opening.txt+X1983..CGP..Tax.Increase...Decrease.txt
CGP.1983.Foreign<-X1983..CGP..Foreign.Policy...Defense.txt+X1983..CGP..Defense.Spending.txt+X1983..CGP..Nuclear.Disarmament.txt+X1983..CGP..Tanaka.Problem.txt
CGP.1983.Societal<-X1983..CGP..Education.Reform.txt+X1983..CGP..Health.Insurance.Benefits.txt

DSP.1983.DomesticPolitics<-X1983..DSP..Constitution.txt+X1983..DSP..Political.Ethics.txt
DSP.1983.Economy<-X1983..DSP..Administrative...Financial.Reform.txt+X1983..DSP..Tax.Reduction...Economy.txt+X1983..DSP..Market.Opening.txt+X1983..DSP..Tax.Increase...Decrease.txt
DSP.1983.Foreign<-X1983..DSP..Foreign.Policy...Defense.txt+X1983..DSP..Defense.Spending.txt+X1983..DSP..Nuclear.Disarmament.txt+X1983..DSP..Tanaka.Problem.txt
DSP.1983.Societal<-X1983..DSP..Education.Reform.txt+X1983..DSP..Health.Insurance.Benefits.txt

JCP.1983.DomesticPolitics<-X1983..JCP..Constitution.txt+X1983..JCP..Political.Ethics.txt
JCP.1983.Economy<-X1983..JCP..Administrative...Financial.Reform.txt+X1983..JCP..Tax.Reduction...Economy.txt+X1983..JCP..Market.Opening.txt+X1983..JCP..Tax.Increase...Decrease.txt
JCP.1983.Foreign<-X1983..JCP..Foreign.Policy...Defense.txt+X1983..JCP..Defense.Spending.txt+X1983..JCP..Nuclear.Disarmament.txt+X1983..JCP..Tanaka.Problem.txt
JCP.1983.Societal<-X1983..JCP..Educational.Reform.txt+X1983..JCP..Health.Insurance.Benefits.txt

JSP.1983.DomesticPolitics<-X1983..JSP..Constitution.txt+X1983..JSP..Political.Ethics.txt
JSP.1983.Economy<-X1983..JSP..Administrative...Financial.Reform.txt+X1983..JSP..Tax.Reduction...Economy.txt+X1983..JSP..Market.Opening.txt+X1983..JSP..Tax.Increase...Decrease.txt
JSP.1983.Foreign<-X1983..JSP..Foreign.Policy...Defense.txt+X1983..JSP..Defense.Spending.txt+X1983..JSP..Nuclear.Disarmament.txt+X1983..JSP..Tanaka.Problem.txt
JSP.1983.Societal<-X1983..JSP..Education.Reform.txt+X1983..JSP..Health.Insurance.Benefits.txt

LDP.1983.DomesticPolitics<-X1983..LDP..Constitution.txt+X1983..LDP..Political.Ethics.txt
LDP.1983.Economy<-X1983..LDP..Administrative...Financial.Reform.txt+X1983..LDP..Tax.Reduction...Economy.txt+X1983..LDP..Market.Opening.txt+X1983..LDP..Tax.Increase...Decrease.txt
LDP.1983.Foreign<-X1983..LDP..Foreign.Policy...Defense.txt+X1983..LDP...Defense.Spending.txt+X1983..LDP..Nuclear.Disarmament.txt+X1983..LDP..Tanaka.Problem.txt
LDP.1983.Societal<-X1983..LDP..Education.Reform.txt+X1983..LDP..Health.Insurance.Benefits.txt

NLC.1983.DomesticPolitics<-X1983..NLC..Constitution.txt+X1983..NLC..Political.Ethics.txt
NLC.1983.Economy<-X1983..NLC..Administrative...Financial.Reform.txt+X1983..NLC..Tax.Reduction...Economy.txt+X1983..NLC..Market.Opening.txt+X1983..NLC..Tax.Increase...Decrease.txt
NLC.1983.Foreign<-X1983..NLC..Foreign.Policy...Defense.txt+X1983..NLC..Defense.Spending.txt+X1983..NLC..Nuclear.Disarmament.txt+X1983..NLC..Tanaka.Problem.txt
NLC.1983.Societal<-X1983..NLC..Education.Reform.txt+X1983..NLC..Health.Insurance.Benefits.txt

REN.1983.Economy<-X1983..REN..Market.Opening.txt+X1983..REN..Tax.Increase...Decrease.txt
REN.1983.Foreign<-X1983..REN..Defense.Spending.txt+X1983..REN..Nuclear.Disarmament.txt+X1983..REN..Tanaka.Problem.txt
REN.1983.Societal<-X1983..REN..Education.Reform.txt+X1983..REN..Health.Insurance.Benefits.txt

### Excluded items for 1983:
### X1983..CGP..Other.Important.Policy.txt
### X1983..DSP..Other.Important.Policy.txt
### X1983..JCP..Other.Important.Policy.txt
### X1983..JSP..Other.Important.Policy.txt
### X1983..LDP..Other.Important.Policy.txt
### X1983..NCA..E.T.C.txt
### X1983..NLC..Other.Important.Policy.txt
### X1983..NSP..E.T.C.txt
### X1983..UHC..E.T.C.txt
### X1983..WP..E.T.C.txt


###### 1986 ELECTION #######

CGP.1986.DomesticPolitics<-X1986..CGP..Constitution.txt+X1986..CGP..Political.Ethics.txt
CGP.1986.Economy<-X1986..CGP..Tax.System.txt+X1986..CGP..Yen.Appreciation.txt+X1986..CGP..Administration...Finance.Reform.txt
CGP.1986.Foreign<-X1986..CGP..Foreign.Policy...Defense.txt
CGP.1986.Societal<-X1986..CGP..Education.txt+X1986..CGP..Nuclear.Power.Plant.txt

DSP.1986.DomesticPolitics<-X1986..DSP..Constitution.txt+X1986..DSP..Political.Ethics.txt
DSP.1986.Economy<-X1986..DSP..Administration...Finance.Reform.txt+X1986..DSP..Tax.System.txt+X1986..DSP..Yen.Appreciaation.txt
DSP.1986.Foreign<-X1986..DSP..Foreign.Policy...Defense.txt
DSP.1986.Societal<-X1986..DSP..Education.txt+X1986..DSP..Nuclear.Power.Plant.txt

JCP.1986.DomesticPolitics<-X1986..JCP..Constitution.txt+X1986..JCP..Political.Ethics.txt
JCP.1986.Economy<-X1986..JCP..Administration...Finance.Reform.txt+X1986..JCP..Tax.System.txt+X1986..JCP..Yen.Appreciation.txt
JCP.1986.Foreign<-X1986..JCP..Foreign.Policy...Defense.txt
JCP.1986.Societal<-X1986..JCP..Education.txt+X1986..JCP..Nuclear.Power.Plant.txt

JSP.1986.DomesticPolitics<-X1986..JSP..Constitution.txt+X1986..JSP..Political.Ethics.txt
JSP.1986.Economy<-X1986..JSP..Administration...Finance.Reform.txt+X1986..JSP..Tax.System.txt+X1986..JSP..Yen.Appreciation.txt
JSP.1986.Foreign<-X1986..JSP..Foreign.Policy...Defense.txt
JSP.1986.Societal<-X1986..JSP..Education.txt+X1986..JSP..Nuclear.Power.Plant.txt

LDP.1986.DomesticPolitics<-X1986..LDP..Constitution.txt+X1986..LDP..Political.Ethics.txt
LDP.1986.Economy<-X1986..LDP..Administration...Finance.Reform.txt+X1986..LDP..Tax.System.txt+X1986..LDP..Yen.Appreciation.txt
LDP.1986.Foreign<-X1986..LDP..Foreign.Policy...Defense.txt
LDP.1986.Societal<-X1986..LDP..Education.txt+X1986..LDP..Nuclear.Power.Plant.txt

NLC.1986.DomesticPolitics<-X1986..NLC..Constitution.txt+X1986..NLC..Political.Ethics.txt
NLC.1986.Economy<-X1986..NLC..Administration...Finance.Reform.txt+X1986..NLC..Tax.System.txt+X1986..NLC..Yen.Appreciation.txt
NLC.1986.Foreign<-X1986..NLC..Foreign.Policy...Defense.txt
NLC.1986.Societal<-X1986..NLC..Education.txt+X1986..NLC..Nuclear.Power.Plant.txt

REN.1986.DomesticPolitics<-X1986..REN..Constitution.txt+X1986..REN..Political.Ethics.txt
REN.1986.Economy<-X1986..REN..Administration...Finance.Reform.txt+X1986..REN..Tax.System.txt+X1986..REN..Yen.Appreciation.txt
REN.1986.Foreign<-X1986..REN..Foreign.Policy...Defense.txt
REN.1986.Societal<-X1986..REN..Education.txt+X1986..REN..Nuclear.Power.Plant.txt

### Excluded items in 1986:
### X1986..CGP..Emphasis.txt
### X1986..DSP..Emphasis.txt
### X1986..JCP..Emphasis.txt
### X1986..JSP..Emphasis.txt
### X1986..LDP..Emphasis.txt
### X1986..NLC..Emphasis.txt
### X1986..NSP..E.T.C.txt
### X1986..REN..Emphasis.txt
### X1986..TP..E.T.C.txt
### X1986..UHC..E.T.C.txt
### X1986..WP..E.T.C.txt


###### 1989 ELECTION #######

CGP.1989.DomesticPolitics<-X1989..CGP..Political.Reform.txt
CGP.1989.Economy<-X1989..CGP..Agriculture.Policies.txt+X1989..CGP..Consumption.Tax.txt+X1989..CGP..Land....Housing.txt
CGP.1989.Foreign<-X1989..CGP..Foreign.Policy...Defense.txt

DSP.1989.DomesticPolitics<-X1989..DSP..Political.Reform.txt
DSP.1989.Economy<-X1989..DSP..Agriculture.Policies.txt+X1989..DSP..Consumption.Tax.txt+X1989..DSP..Land...Housing.txt
DSP.1989.Foreign<-X1989..DSP..Foreign.Policy...Defense.txt

JCP.1989.DomesticPolitics<-X1989..JCP..Political.Reform.txt
JCP.1989.Economy<-X1989..JCP..Agriculture.Policies.txt+X1989..JCP..Consumption.Tax.txt+X1989..JCP..Land...Housing.txt
JCP.1989.Foreign<-X1989..JCP..Foreign.Policy...Defense.txt

JSP.1989.DomesticPolitics<-X1989..JSP..Political.Reform.txt
JSP.1989.Economy<-X1989..JSP..Agriculture.Policies.txt+X1989..JSP..Consumption.Tax.txt+X1989..JSP..Land...Housing.txt
JSP.1989.Foreign<-X1989..JSP..Foreign.Policy...Defense.txt

LDP.1989.DomesticPolitics<-X1989..LDP..Political.Reform.txt
LDP.1989.Economy<-X1989..LDP..Agriculture.Policies.txt+X1989..LDP..Consumption.Tax.txt+X1989..LDP..Land...Housing.txt
LDP.1989.Foreign<-X1989..LDP..Foreign.Policy...Defense.txt


### Excluded items in 1989:
### X1989..CGP..Other.Important.Policy.txt
### X1989..DSP..Other.Important.Policy.txt
### X1989..JCP..Other.Important.Policy.txt
### X1989..JSP..Other.Important.Policy.txt
### X1989..LDP..Other.Important.Policy.txt
### X1989..NP..E.T.C.txt
### X1989..NSP..E.T.C.txt
### X1989..PP..E.T.C.txt
### X1989..REN..E.T.C.txt
### X1989..SP..E.T.C.txt
### X1989..TP..E.T.C.txt
### X1989..UHC..E.T.C.txt



###### 1990 ELECTION #######

CGP.1990.DomesticPolitics<-X1990..CGP..Conception.of.Political.Power.txt+X1990..CGP..Political.Reform.txt
CGP.1990.Economy<-X1990..CGP..Agriculture.Policy.txt+X1990..CGP..Consumption.Tax.txt+X1990..CGP..Land...Housing.txt
CGP.1990.Foreign<-X1990..CGP..Foreign.Policy...Defense.txt

DSP.1990.DomesticPolitics<-X1990..DSP..Conception.of.Political.Power.txt+X1990..DSP..Political.Reform.txt
DSP.1990.Economy<-X1990..DSP..Agriculture.Policy.txt+X1990..DSP..Consumption.Tax.txt+X1990..DSP..Land...Housing.txt
DSP.1990.Foreign<-X1990..DSP..Foreign.Policy...Defense.txt

JCP.1990.DomesticPolitics<-X1990..JCP..Conception.of.Political.Power.txt+X1990..JCP..Political.Reform.txt
JCP.1990.Economy<-X1990..JCP..Consumption.Tax.txt+X1990..JCP..Land...Housing.txt
JCP.1990.Foreign<-X1990..JCP..Foreign.Policy...Defense.txt
#note: JCP missing agriculture policy (economy) in 1990

JSP.1990.DomesticPolitics<-X1990..JSP..Conception.of.Political.Power.txt+X1990..JSP..Political.Reform.txt
JSP.1990.Economy<-X1990..JSP..Agriculture.Policy.txt+X1990..JSP..Consumption.Tax.txt+X1990..JSP..Land...Housing.txt
JSP.1990.Foreign<-X1990..JSP..Foreign.Policy...Defense.txt

LDP.1990.DomesticPolitics<-X1990..LDP..Conception.of.Political.Power.txt+X1990..LDP..Political.Reform.txt
LDP.1990.Economy<-X1990..LDP..Agriculture.Policy.txt+X1990..LDP..Consumption.Tax.txt+X1990..LDP..Land...Housing.txt
LDP.1990.Foreign<-X1990..LDP..Foreign.Policy...Defense.txt

PP.1990.DomesticPolitics<-X1990..PP..Conception.of.Political.Power.txt+X1990..PP..Political.Reform.txt
PP.1990.Economy<-X1990..PP..Agriculture.Policy.txt+X1990..PP..Consumption.Tax.txt+X1990..PP..Land...Housing.txt
PP.1990.Foreign<-X1990..PP..Foreign.Policy...Defense.txt

REN.1990.DomesticPolitics<-X1990..REN..Conception.of.Political.Power.txt+X1990..REN..Political.Reform.txt
REN.1990.Economy<-X1990..REN..Agriculture.Policy.txt+X1990..REN..Consumption.Tax.txt+X1990..REN..Land...Housing.txt
REN.1990.Foreign<-X1990..REN..Foreign.Policy...Defense.txt


###### 1993 ELECTION #######
CGP.1993.DomesticPolitics<-X1993..CGP..Conditions.for.Coalition.Cabinet.txt+X1993..CGP..Constitution.txt+ X1993..CGP..Electoral.System.txt+X1993..CGP..Political.Donation.txt
CGP.1993.Economy<-X1993..CGP..Product.Liability.txt+ X1993..CGP..Rice.txt+ X1993..CGP..Consumption.Tax.txt
CGP.1993.Foreign<-X1993..CGP..International.Contribution.txt+X1993..CGP..Self.Defense.Force.txt+X1993..CGP..UN.Security.Council.txt
CGP.1993.Societal<-X1993..CGP..Nuclear.Power.Plant.txt

DSP.1993.DomesticPolitics<-X1993..DSP..Conditions.for.Coalition.Cabinet.txt+X1993..DSP..Constitution.txt+ X1993..DSP..Electoral.System.txt+X1993..DSP..Political.Donation.txt
DSP.1993.Economy<-X1993..DSP..Product.Liability.txt+ X1993..DSP..Rice.txt+ X1993..DSP..Consumption.Tax.txt
DSP.1993.Foreign<-X1993..DSP..International.Contribution.txt+X1993..DSP..Self.Defense.Force.txt+X1993..DSP..UN.Security.Council.txt
DSP.1993.Societal<-X1993..DSP..Nuclear.Power.Plant.txt

JCP.1993.DomesticPolitics<- X1993..JCP..Condition.for.Coalition.Cabinet.txt+X1993..JCP..Constitution.txt+ X1993..JCP..Electoral.System.txt+X1993..JCP..Political.Donation.txt
JCP.1993.Economy<-X1993..JCP..Product.Liability.txt+ X1993..JCP..Rice.txt+ X1993..JCP..Consumption.Tax.txt
JCP.1993.Foreign<-X1993..JCP..International.Contribution.txt+X1993..JCP..Self.Defense.Force.txt+X1993..JCP..UN.Security.Council.txt
JCP.1993.Societal<-X1993..JCP..Nuclear.Power.Plant.txt

JNP.1993.DomesticPolitics<-X1993..JNP..Conditions.for.Coalition.Cabinet.txt+X1993..JNP..Constitution.txt+ X1993..JNP..Electoral.System.txt+X1993..JNP..Political.Donation.txt
JNP.1993.Economy<-X1993..JNP..Product.Liability.txt+ X1993..JNP..Rice.txt+ X1993..JNP..Consumption.Tax.txt
JNP.1993.Foreign<-X1993..JNP..International.Contribution.txt+X1993..JNP..Self.Defense.Force.txt+X1993..JNP..UN.Security.Council.txt
JNP.1993.Societal<-X1993..JNP..Nuclear.Power.Plant.txt

JRP.1993.DomesticPolitics<-X1993..JRP..Conditions.for.Coalition.Cabinet.txt+X1993..JRP..Constitution.txt+ X1993..JRP..Electoral.System.txt+X1993..JRP..Political.Donation.txt
JRP.1993.Economy<-X1993..JRP..Product.Liability.txt+ X1993..JRP..Rice.txt+ X1993..JRP..Consumption.Tax.txt
JRP.1993.Foreign<-X1993..JRP..International.Contribution.txt+X1993..JRP..Self.Defense.Force.txt+X1993..JRP..UN.Security.Council.txt
JRP.1993.Societal<-X1993..JRP..Nuclear.Power.Plant.txt

JSP.1993.DomesticPolitics<-X1993..JSP..Conditions.for.Coalition.Cabinet.txt+X1993..JSP..Constitution.txt+ X1993..JSP..Electoral.System.txt+X1993..JSP..Political.Donation.txt
JSP.1993.Economy<-X1993..JSP..Product.Liability.txt+ X1993..JSP..Rice.txt+ X1993..JSP..Consumption.Tax.txt
JSP.1993.Foreign<-X1993..JSP..Interntional.Contribution.txt+X1993..JSP..Self.Defense.Force.txt+X1993..JSP..UN.Security.Council.txt
JSP.1993.Societal<-X1993..JSP..Nuclear.Power.Plant.txt

LDP.1993.DomesticPolitics<-X1993..LDP..Conditions.for.Coalition.Cabinet.txt+X1993..LDP..Constitution.txt+ X1993..LDP..Electoral.System.txt+X1993..LDP..Political.Donation.txt
LDP.1993.Economy<- X1993..LDP..Product.Liablity.txt + X1993..LDP..Rice.txt+ X1993..LDP..Consumption.Tax.txt
LDP.1993.Foreign<-X1993..LDP..International.Contribution.txt+X1993..LDP..Self.Defense.Force.txt+X1993..LDP..UN.Security.Council.txt
LDP.1993.Societal<-X1993..LDP..Nuclear.Power.Plant.txt

NPS.1993.DomesticPolitics<-X1993..NPS..Conditions.for.Coalition.Cabinet.txt+X1993..NPS..Constitution.txt+ X1993..NPS..Electoral.System.txt+X1993..NPS..Political.Donation.txt
NPS.1993.Economy<-X1993..NPS..Product.Liability.txt+ X1993..NPS..Rice.txt+ X1993..NPS..Consumption.Tax.txt
NPS.1993.Foreign<-X1993..NPS..International.Contribution.txt+X1993..NPS..Self.Defense.Force.txt+X1993..NPS..UN.Security.Council.txt
NPS.1993.Societal<-X1993..NPS..Nuclear.Power.Plant.txt

REN.1993.DomesticPolitics<-X1993..REN..Conditions.for.Coalition.Cabinet.txt+X1993..REN..Constitution.txt+ X1993..REN..Electoral.System.txt+X1993..REN..Political.Donation.txt
REN.1993.Economy<-X1993..REN..Product.Liability.txt+ X1993..REN..Rice.txt+ X1993..REN..Consumption.Tax.txt
REN.1993.Foreign<-X1993..REN..International.Contribution.txt+X1993..REN..Self.Defense.Force.txt+X1993..REN..UN.Security.Council.txt
REN.1993.Societal<-X1993..REN..Nuclear.Power.Plant.txt


#### Election 1995 ####

DRP.1995.DomesticPolitics<-X1995..DRP..Administrative.Reform.and.Local.Autonomy.txt
DRP.1995.Economy<-X1995..DRP..Economic.Policy.txt
DRP.1995.Foreign<- X1995..DRP..Japan.on.International.Stage.txt
DRP.1995.Societal<-X1995..DRP..Social.Welfare.txt

GFU.1995.Economy<-X1995..GFU..Economic.Policy.txt
GFU.1995.Foreign<-X1995..GFU..Security.Council.and.Defense.txt

HCC.1995.DomesticPolitics<-X1995..HCC..Administrative.Reform.and.Local.Autonomy.txt
HCC.1995.Economy<-X1995..HCC..Economic.Policy.txt
HCC.1995.Foreign<- X1995..HCC..Japan.on.International.Stage.txt+ X1995..HCC..Security.Council.and.Defense.txt
HCC.1995.Societal<-X1995..HCC..Social.Welfare.txt

JCP.1995.DomesticPolitics<-X1995..JCP..Administrative.Reform.and.Local.Autonomy.txt
JCP.1995.Economy<-X1995..JCP..Economic.Policy.txt
JCP.1995.Foreign<- X1995..JCP..Japan.on.International.Stage.txt+ X1995..JCP..Security.Council.and.Defense.txt
JCP.1995.Societal<- X1995..JCP..Social.Welfare.txt

JSP.1995.DomesticPolitics<-X1995..JSP..Administrative.Reform.and.Local.Autonomy.txt
JSP.1995.Economy<-X1995..JSP..Economic.Policy.txt
JSP.1995.Foreign<- X1995..JSP..Japan.on.International.Stage.txt+ X1995..JSP..Security.Council.and.Defense.txt
JSP.1995.Societal<- X1995..JSP..Social.Welfare.txt

LDP.1995.DomesticPolitics<-X1995..LDP..Administratice.Reform.and.Local.Autonomy.txt
LDP.1995.Economy<-X1995..LDP..Economic.Policy.txt
LDP.1995.Foreign<- X1995..LDP..Japan.on.International.Stage.txt+  X1995..LDP..Security.Councila.dn.Defense.txt 
LDP.1995.Societal<- X1995..LDP..Social.Welfare.txt

NFP.1995.DomesticPolitics<-X1995..NFP..Administrative.Reform.and.Local.Autonomy.txt
NFP.1995.Economy<-X1995..NFP..Economic.Policy.txt
NFP.1995.Foreign<- X1995..NFP..Japan.on.International.Stage.txt+ X1995..NFP..Security.Council.and.Defense.txt
NFP.1995.Societal<- X1995..NFP..Social.Welfare.txt

NPS.1995.DomesticPolitics<-X1995..NPS..Administrative.Reform.and.Local.Autonomy.txt
NPS.1995.Economy<-X1995..NPS..Economic.Policy.txt
NPS.1995.Foreign<- X1995..NPS..Japan.on.International.Stage.txt+ X1995..NPS..Security.Council.and.Defense.txt
NPS.1995.Societal<- X1995..NPS..Social.Welfare.txt

PCP.1995.DomesticPolitics<-X1995..PCP..Administrative.Reform.and.Local.Autonomy.txt
PCP.1995.Economy<-X1995..PCP..Economic.Policy.txt
PCP.1995.Foreign<- X1995..PCP..Security.Council.and.Defense.txt
PCP.1995.Societal<- X1995..PCP..Social.Welfare.txt

SPP.1995.DomesticPolitics<-X1995..SPP..Administrative.Reform.and.Local.Autonomy.txt
SPP.1995.Economy<-X1995..SPP..Economic.Policy.txt
SPP.1995.Foreign<- X1995..SPP..Security.Council.and.Defense.txt
SPP.1995.Societal<- X1995..SPP..Social.Welfare.txt

###Excluded texts 1995
# all 50 Years since WWII.txt
#X1995, HRG, Social Welfare.txt
#X1995..FL..Economic.Policy.txt
#X1995..SNP.txt
#X1995..TCP21..Administrative.Reform.and.Local.Autonomy.txt
#X1995..YLP..Economic.Policy.txt

##### Election 1996 ######

DPJ.1996.DomesticPolitics<-X1996..DPJ..Administrative.txt+X1996..DPJ..Political.Fund.txt
DPJ.1996.Economy<- X1996..DPJ..Consumption.Tax.txt+X1996..DPJ..Financial.Reform.txt+X1996..DPJ..Relocation.of.Capital.Function.txt
DPJ.1996.Foreign<- X1996..DPJ..Contigency.Legislation.and.Support.for.the.U.S..txt
DPJ.1996.Societal<- X1996..DPJ..Freedom.of.Information.Act.txt + X1996..DPJ..Nursing.Care.Insurance.txt 
#note: did not use X1996..DPJ..Contigency.Legislation.and.Support.for.the.U.S..docx.txt
# this is different from the the variable used. Not sure which is correct

DRP.1996.DomesticPolitics<-X1996..DRP..Administrative.Reform.txt+X1996..DRP..Political.Fund.txt
DRP.1996.Economy<- X1996..DRP..Consumption.Tax.txt+X1996..DRP..Financial.Reform.txt+X1996..DRP..Relocation.of.Capital.Function.txt
DRP.1996.Foreign<- X1996..DRP..Contigency.Legislation.and.Support.for.the.U.S..txt+ X1996..DRP..Security.Treaty.txt
DRP.1996.Societal<-X1996..DRP..Freedom.of.Information.Act.txt+ X1996..DRP..Nursing.Care.Insurance.txt 

JCP.1996.DomesticPolitics<-X1996..JCP..Administrative.Reform.txt+X1996..JCP..Political.Fund.txt
JCP.1996.Economy<- X1996..JCP..Consumption.Tax.txt+X1996..JCP..Financial.Reform.txt+X1996..JCP..Relocation.of.Capital.Function.txt
JCP.1996.Foreign<- X1996..JCP..Contigency.Legislaton.and.Support.for.the.U.S..txt+ X1996..JCP..Security.Treaty.txt
JCP.1996.Societal<-X1996..JCP..Freedom.of.Information.Act.txt+ X1996..JCP..Nursing.Care.Insurance.txt 

LDP.1996.DomesticPolitics<-X1996..LDP..Administrative.Reform.txt+X1996..LDP..Political.Fund.txt
LDP.1996.Economy<- X1996..LDP..Consumption.Tax.txt+X1996..LDP..Financial.Reform.txt+X1996..LDP..Relocation.of.Capital.Function.txt
LDP.1996.Foreign<- X1996..LDP..Contigency.Legislation.and.Support.for.the.U.S..txt+ X1996..LDP..Security.Treaty.txt
LDP.1996.Societal<-X1996..LDP..Freedom.of.Information.Act.txt+ X1996..LDP..Nursing.Care.Insurance.txt 

LL.1996.DomesticPolitics<-X1996..LL..Administrative.Reform.txt+X1996..LL..Political.Fund.txt
LL.1996.Economy<- X1996..LL..Consmption.Tax.txt+X1996..LL..Financial.Reform.txt+X1996..LL..Relocation.of.Capital.Function.txt
LL.1996.Foreign<- X1996..LL..Contigency.Legislation.and.Support.for.the.U.S..txt+ X1996..LL..Security.Treaty.txt
LL.1996.Societal<-X1996..LL..Nursing.Care.Insurance.txt 
#note: LL missing X1996..LL..Freedom.of.Information.Act.txt

NFP.1996.DomesticPolitics<-X1996..NFP..Administrative.Reform.txt+X1996..NFP..Political.Fund.txt
NFP.1996.Economy<- X1996..NFP..Consumption.Tax.txt+X1996..NFP..Financial.Reform.txt+X1996..NFP..Relocation.of.Capital.Function.txt
NFP.1996.Foreign<- X1996..NFP..Contigency.Legislation.and.Support.for.the.U.S..txt+ X1996..NFP..Security.Treaty.txt
NFP.1996.Societal<-X1996..NFP..Freedom.of.Information.Act.txt+ X1996..NFP..Nursing.Care.Insurance.txt 

NSP.1996.DomesticPolitics<-X1996..NSP..Administrative.Reform.txt+X1996..NSP..Political.Fund.txt
NSP.1996.Economy<- X1996..NSP..Consumption.Tax.txt+X1996..NSP..Financial.Reform.txt+X1996..NSP..Relocation.of.Capital.Function.txt
NSP.1996.Foreign<- X1996..NSP..Contigency.Legislation.and.Support.for.the.U.S..txt+ X1996..NSP..Security.Treaty.txt
NSP.1996.Societal<-X1996..NSP..Freedom.of.Information.Act.txt+ X1996..NSP..Nursing.Care.Insurance.txt 

NPS.1996.DomesticPolitics<-X1996..NPS..Administrative.Reform.txt+X1996..NPS..Political.Fund.txt
NPS.1996.Economy<- X1996..NPS..Consumption.Tax.txt+X1996..NPS..Financial.Reform.txt+X1996..NPS..Relocation.of.Capital.Function.txt
NPS.1996.Foreign<- X1996..NPS..Contigency.Legislation.and.Support.for.the.U.S..txt+ X1996..NPS..Security.Treaty.txt
NPS.1996.Societal<-X1996..NPS..Freedom.of.Information.Act.txt+ X1996..NPS..Nursing.Care.Insurance.txt 

SDP.1996.DomesticPolitics<-X1996..SDP..Administrative.Reform.txt+X1996..SDP..Political.Fund.txt
SDP.1996.Economy<- X1996..SDP..Consumption.Tax.txt+X1996..SDP..Financial.Reform.txt+X1996..SDP..Relocation.of.Capital.Function.txt
SDP.1996.Foreign<- X1996..SDP..Contigency.Legislation.and.Support.for.the.U.S..txt+ X1996..SDP..Security.Treaty.txt
SDP.1996.Societal<-X1996..SDP..Freedom.of.Information.Act.txt+ X1996..SDP..Nursing.Care.Insurance.txt 


#### Election 1998 ######
CGP.1998.DomesticPolitics<-X1998..CGP..Administrative.Reform.txt
CGP.1998.Economy<- X1998..CGP..Economic.Policy.txt
CGP.1998.Foreign<- X1998..CGP..Security.Treaty.and.Defense.txt 
CGP.1998.Societal<-X1998..CGP..Environmental.Security.txt+X1998..CGP..Social.Welfare.txt

DPJ.1998.DomesticPolitics<-X1998..DPJ..Administrative.Reform.txt
DPJ.1998.Economy<- X1998..DPJ..Economic.Policy.txt
DPJ.1998.Foreign<-  X1998..DPJ..Security.Treaty.and.Defense.txt
DPJ.1998.Societal<- X1998..DPJ..Environmental.Security.txt+X1998..DPJ..Social.Welfare.txt

HCC.1998.DomesticPolitics<-X1998..HCC..Administrative.Reform.txt
HCC.1998.Economy<- X1998..HCC..Economic.Policy.txt
HCC.1998.Foreign<-  X1998..HCC..Security.Treaty.and.Defense.txt
HCC.1998.Societal<- X1998..HCC..Social.Security.txt+X1998..HCC..Environmental.Security.txt

JCP.1998.DomesticPolitics<-X1998..JCP..Administrative.Reform.txt
JCP.1998.Economy<- X1998..JCP..Economic.Policy.txt
JCP.1998.Foreign<-  X1998..JCP..Security.Treaty.and.Defense.txt
JCP.1998.Societal<-  X1998..JCP..Environmental.Security.txt+ X1998..JCP..Social.War.txt

LDP.1998.DomesticPolitics<-X1998..LDP..Administrative.Reform.txt
LDP.1998.Economy<- X1998..LDP..Economic.Policy.txt
LDP.1998.Foreign<- X1998..LDP..Security.Treaty.and.Defense.txt
LDP.1998.Societal<- X1998..LDP..Environmental.Security.txt+X1998..LDP..Social.Welfare.txt

LP.1998.DomesticPolitics<-X1998..LP..Administrative.Reform.txt
LP.1998.Economy<- X1998..LP..Economic.Policy.txt
LP.1998.Foreign<-  X1998..LP..Security.Treaty.and.Defense.txt
LP.1998.Societal<-X1998..LP..Environmental.Security.txt+X1998..LP..Social.Welfare.txt

NPS.1998.DomesticPolitics<-X1998..NPS..Administrative.Reform.txt
NPS.1998.Economy<- X1998..NPS..Economic.Policy.txt
NPS.1998.Foreign<- X1998..NPS..Security.Treaty.and.Defense.txt 
NPS.1998.Societal<- X1998..NPS..Environmental.Security.txt+X1998..NPS..Social.Welfare.txt

NSP.1998.DomesticPolitics<-X1998..NSP..Administrative.Reform.txt
NSP.1998.Economy<- X1998..NSP..Economic.Policy.txt
NSP.1998.Foreign<- X1998..NSP..Security.Treaty.txt
NSP.1998.Societal<- X1998..NSP..Environmental.Security.txt+X1998..NSP..Social.Welfare.txt

SDP.1998.DomesticPolitics<-X1998..SDP..Administrative.Reform.txt
SDP.1998.Economy<-X1998..SDP..Economic.Policy.txt 
SDP.1998.Foreign<- X1998..SDP..Security.Treaty.and.Defense.txt 
SDP.1998.Societal<- X1998..SDP..Environmental.Security.txt+X1998..SDP..Social.Welfare.txt

# Excluded texts
# X1998..LL.txt
# X1998..SPP.txt
# X1998..WP.txt X1998..YLP.txt

###### Combine Domestic and Societal Policies #######
###### CREATE FIVE YEAR PERIODS 1960-1990 ########
DSP.6064.DomSoc<-DSP.1960.DomesticPolitics+DSP.1962.DomesticPolitics+DSP.1963.DomesticPolitics+DSP.1960.Societal+DSP.1962.Societal+DSP.1963.Societal
DSP.6064.Economy<-DSP.1960.Economy+DSP.1962.Economy+DSP.1963.Economy
DSP.6064.Foreign<-DSP.1960.Foreign+DSP.1962.Foreign+DSP.1963.Foreign


JCP.6064.DomSoc <-JCP.1960.DomesticPolitics+JCP.1962.DomesticPolitics+JCP.1963.DomesticPolitics+JCP.1960.Societal+JCP.1962.Societal+JCP.1963.Societal
JCP.6064.Economy<-JCP.1960.Economy+JCP.1962.Economy+JCP.1963.Economy
JCP.6064.Foreign<-JCP.1960.Foreign+JCP.1962.Foreign+JCP.1963.Foreign

JSP.6064.DomSoc <-JSP.1960.DomesticPolitics+JSP.1962.DomesticPolitics+JSP.1963.DomesticPolitics+JSP.1960.Societal+JSP.1962.Societal+JSP.1963.Societal
JSP.6064.Economy<-JSP.1960.Economy+JSP.1962.Economy+JSP.1963.Economy
JSP.6064.Foreign<-JSP.1960.Foreign+JSP.1962.Foreign+JSP.1963.Foreign

LDP.6064.DomSoc <-LDP.1960.DomesticPolitics+LDP.1962.DomesticPolitics+LDP.1963.DomesticPolitics+LDP.1960.Societal+LDP.1962.Societal+LDP.1963.Societal
LDP.6064.Economy<-LDP.1960.Economy+LDP.1962.Economy+LDP.1963.Economy
LDP.6064.Foreign<-LDP.1960.Foreign+LDP.1962.Foreign+LDP.1963.Foreign

CGP.6569.DomSoc <-CGP.1965.DomesticPolitics+CGP.1968.DomesticPolitics+CGP.1969.DomesticPolitics+CGP.1965.Societal+CGP.1967.Societal+CGP.1968.Societal+CGP.1969.Economy
CGP.6569.Economy<-CGP.1965.Economy+CGP.1967.Economy+CGP.1968.Economy+CGP.1969.Economy
CGP.6569.Foreign<-CGP.1965.Foreign+CGP.1967.Foreign+CGP.1968.Foreign+CGP.1969.Economy

DSP.6569.DomSoc<-DSP.1965.DomesticPolitics+DSP.1968.DomesticPolitics+DSP.1969.DomesticPolitics+DSP.1965.Societal+DSP.1967.Societal+DSP.1968.Societal+DSP.1969.Economy
DSP.6569.Economy<-DSP.1965.Economy+DSP.1967.Economy+DSP.1968.Economy+DSP.1969.Economy
DSP.6569.Foreign<-DSP.1965.Foreign+DSP.1967.Foreign+DSP.1968.Foreign+DSP.1969.Economy

JCP.6569.DomSoc<-JCP.1965.DomesticPolitics+JCP.1968.DomesticPolitics+JCP.1969.DomesticPolitics+JCP.1965.Societal+JCP.1967.Societal+JCP.1968.Societal+JCP.1969.Economy
JCP.6569.Economy<-JCP.1965.Economy+JCP.1967.Economy+JCP.1968.Economy+JCP.1969.Economy
JCP.6569.Foreign<-JCP.1965.Foreign+JCP.1967.Foreign+JCP.1968.Foreign+JCP.1969.Economy

JSP.6569.DomSoc<-JSP.1965.DomesticPolitics+JSP.1968.DomesticPolitics+JSP.1969.DomesticPolitics+JSP.1965.Societal+JSP.1967.Societal+JSP.1968.Societal+JSP.1969.Economy
JSP.6569.Economy<-JSP.1965.Economy+JSP.1967.Economy+JSP.1968.Economy+JSP.1969.Economy
JSP.6569.Foreign<-JSP.1965.Foreign+JSP.1967.Foreign+JSP.1968.Foreign+JSP.1969.Economy

LDP.6569.DomSoc<-LDP.1965.DomesticPolitics+LDP.1968.DomesticPolitics+LDP.1969.DomesticPolitics+LDP.1965.Societal+LDP.1967.Societal+LDP.1968.Societal+LDP.1969.Economy
LDP.6569.Economy<-LDP.1965.Economy+LDP.1967.Economy+LDP.1968.Economy+LDP.1969.Economy
LDP.6569.Foreign<-LDP.1965.Foreign+LDP.1967.Foreign+LDP.1968.Foreign+LDP.1969.Economy


CGP.7172.DomSoc<-CGP.1972.DomesticPolitics+CGP.1971.Societal+CGP.1972.Societal
CGP.7172.Economy<-CGP.1971.Economy+CGP.1972.Economy
CGP.7172.Foreign<-CGP.1971.Foreign+CGP.1972.Foreign

DSP.7172.DomSoc<-DSP.1972.DomesticPolitics+DSP.1971.Societal+DSP.1972.Societal
DSP.7172.Economy<-DSP.1971.Economy+DSP.1972.Economy
DSP.7172.Foreign<-DSP.1971.Foreign+DSP.1972.Foreign

JCP.7172.DomSoc<-JCP.1972.DomesticPolitics+JCP.1971.Societal+JCP.1972.Societal
JCP.7172.Economy<-JCP.1971.Economy+JCP.1972.Economy
JCP.7172.Foreign<-JCP.1971.Foreign+JCP.1972.Foreign


JSP.7172.DomSoc<-JSP.1972.DomesticPolitics+JSP.1971.Societal+JSP.1972.Societal
JSP.7172.Economy<-JSP.1971.Economy+JSP.1972.Economy
JSP.7172.Foreign<-JSP.1971.Foreign+JSP.1972.Foreign


LDP.7172.DomSoc<-LDP.1972.DomesticPolitics+LDP.1971.Societal+LDP.1972.Societal
LDP.7172.Economy<-LDP.1971.Economy+LDP.1972.Economy
LDP.7172.Foreign<-LDP.1971.Foreign+LDP.1972.Foreign


CGP.7679.DomSoc<-CGP.1976.DomesticPolitics+CGP.1977.DomesticPolitics+CGP.1979.DomesticPolitics+CGP.1977.Societal+CGP.1979.Societal
CGP.7679.Economy<-CGP.1977.Economy+CGP.1979.Economy
CGP.7679.Foreign<-CGP.1976.Foreign+CGP.1977.Foreign+CGP.1979.Foreign

DSP.7679.DomSoc<-DSP.1976.DomesticPolitics+DSP.1977.DomesticPolitics+DSP.1979.DomesticPolitics+DSP.1977.Societal+DSP.1979.Societal
DSP.7679.Economy<-DSP.1977.Economy+DSP.1979.Economy
DSP.7679.Foreign<-DSP.1976.Foreign+DSP.1977.Foreign+DSP.1979.Foreign


JCP.7679.DomSoc<-JCP.1976.DomesticPolitics+JCP.1977.DomesticPolitics+JCP.1979.DomesticPolitics+JCP.1977.Societal+JCP.1979.Societal
JCP.7679.Economy<-JCP.1977.Economy+JCP.1979.Economy
JCP.7679.Foreign<-JCP.1976.Foreign+JCP.1977.Foreign+JCP.1979.Foreign


JSP.7679.DomSoc<-JSP.1976.DomesticPolitics+JSP.1977.DomesticPolitics+JSP.1979.DomesticPolitics+JSP.1977.Societal+JSP.1979.Societal
JSP.7679.Economy<-JSP.1977.Economy+JSP.1979.Economy
JSP.7679.Foreign<-JSP.1976.Foreign+JSP.1977.Foreign+JSP.1979.Foreign


LDP.7679.DomSoc<-LDP.1976.DomesticPolitics+LDP.1977.DomesticPolitics+LDP.1979.DomesticPolitics+LDP.1977.Societal+LDP.1979.Societal
LDP.7679.Economy<-LDP.1977.Economy+LDP.1979.Economy
LDP.7679.Foreign<-LDP.1976.Foreign+LDP.1977.Foreign+LDP.1979.Foreign


NLC.7679.DomSoc<-NLC.1976.DomesticPolitics+NLC.1977.DomesticPolitics+NLC.1979.DomesticPolitics+NLC.1977.Societal+NLC.1979.Societal
NLC.7679.Economy<-NLC.1977.Economy+NLC.1979.Economy
NLC.7679.Foreign<-NLC.1976.Foreign+NLC.1977.Foreign+NLC.1979.Foreign

REN.7679.DomSoc<-REN.1979.DomesticPolitics+REN.1979.Societal
REN.7679.Economy<-REN.1979.Economy
REN.7679.Foreign<-REN.1979.Foreign


CGP.8083.DomSoc<-CGP.1980.DomesticPolitics+CGP.1983.DomesticPolitics+CGP.1980.Societal+CGP.1983.Societal
CGP.8083.Economy<-CGP.1980.Economy+CGP.1983.Economy
CGP.8083.Foreign<-CGP.1980.Foreign+CGP.1983.Foreign

DSP.8083.DomSoc<-DSP.1980.DomesticPolitics+DSP.1983.DomesticPolitics+DSP.1980.Societal+DSP.1983.Societal
DSP.8083.Economy<-DSP.1980.Economy+DSP.1983.Economy
DSP.8083.Foreign<-DSP.1980.Foreign+DSP.1983.Foreign


JCP.8083.DomSoc<-JCP.1980.DomesticPolitics+JCP.1983.DomesticPolitics+JCP.1980.Societal+JCP.1983.Societal
JCP.8083.Economy<-JCP.1980.Economy+JCP.1983.Economy
JCP.8083.Foreign<-JCP.1980.Foreign+JCP.1983.Foreign


JSP.8083.DomSoc<-JSP.1980.DomesticPolitics+JSP.1983.DomesticPolitics+JSP.1980.Societal+JSP.1983.Societal
JSP.8083.Economy<-JSP.1980.Economy+JSP.1983.Economy
JSP.8083.Foreign<-JSP.1980.Foreign+JSP.1983.Foreign


LDP.8083.DomSoc<-LDP.1980.DomesticPolitics+LDP.1983.DomesticPolitics+LDP.1980.Societal+LDP.1983.Societal
LDP.8083.Economy<-LDP.1980.Economy+LDP.1983.Economy
LDP.8083.Foreign<-LDP.1980.Foreign+LDP.1983.Foreign


NLC.8083.DomSoc<-NLC.1980.DomesticPolitics+NLC.1983.DomesticPolitics+NLC.1980.Societal+NLC.1983.Societal
NLC.8083.Economy<-NLC.1980.Economy+NLC.1983.Economy
NLC.8083.Foreign<-NLC.1980.Foreign+NLC.1983.Foreign

REN.8083.DomSoc<-REN.1980.DomesticPolitics+REN.1980.Societal+REN.1983.Societal
REN.8083.Economy<-REN.1980.Economy+REN.1983.Economy
REN.8083.Foreign<-REN.1980.Foreign+REN.1983.Foreign



CGP.8690.DomSoc<-CGP.1986.DomesticPolitics+CGP.1989.DomesticPolitics+CGP.1990.DomesticPolitics+CGP.1986.Societal
CGP.8690.Economy<-CGP.1986.Economy+CGP.1989.Economy+CGP.1990.Economy
CGP.8690.Foreign<-CGP.1986.Foreign+CGP.1989.Foreign+CGP.1990.Foreign


DSP.8690.DomSoc<-DSP.1986.DomesticPolitics+DSP.1989.DomesticPolitics+DSP.1990.DomesticPolitics+DSP.1986.Societal
DSP.8690.Economy<-DSP.1986.Economy+DSP.1989.Economy+DSP.1990.Economy
DSP.8690.Foreign<-DSP.1986.Foreign+DSP.1989.Foreign+DSP.1990.Foreign


JCP.8690.DomSoc<-JCP.1986.DomesticPolitics+JCP.1989.DomesticPolitics+JCP.1990.DomesticPolitics+JCP.1986.Societal
JCP.8690.Economy<-JCP.1986.Economy+JCP.1989.Economy+JCP.1990.Economy
JCP.8690.Foreign<-JCP.1986.Foreign+JCP.1989.Foreign+JCP.1990.Foreign


JSP.8690.DomSoc<-JSP.1986.DomesticPolitics+JSP.1989.DomesticPolitics+JSP.1990.DomesticPolitics+JSP.1986.Societal
JSP.8690.Economy<-JSP.1986.Economy+JSP.1989.Economy+JSP.1990.Economy
JSP.8690.Foreign<-JSP.1986.Foreign+JSP.1989.Foreign+JSP.1990.Foreign


LDP.8690.DomSoc<-LDP.1986.DomesticPolitics+LDP.1989.DomesticPolitics+LDP.1990.DomesticPolitics+LDP.1986.Societal
LDP.8690.Economy<-LDP.1986.Economy+LDP.1989.Economy+LDP.1990.Economy
LDP.8690.Foreign<-LDP.1986.Foreign+LDP.1989.Foreign+LDP.1990.Foreign


NLC.8690.DomSoc<-NLC.1986.DomesticPolitics+NLC.1986.Societal
NLC.8690.Economy<-NLC.1986.Economy
NLC.8690.Foreign<-NLC.1986.Foreign


REN.8690.DomSoc<-REN.1986.DomesticPolitics+REN.1990.DomesticPolitics+REN.1986.Societal
REN.8690.Economy<-REN.1986.Economy+REN.1990.Economy
REN.8690.Foreign<-REN.1986.Foreign+REN.1990.Foreign

PP.8690.DomSoc<-PP.1990.DomesticPolitics
PP.8690.Economy<-PP.1990.Economy
PP.8690.Foreign<-PP.1990.Foreign


CGP.9395.DomSoc<-CGP.1993.DomesticPolitics+CGP.1993.Societal
CGP.9395.Economy<-CGP.1993.Economy
CGP.9395.Foreign<-CGP.1993.Foreign


DSP.9395.DomSoc<-DSP.1993.DomesticPolitics+DSP.1993.Societal
DSP.9395.Economy<-DSP.1993.Economy
DSP.9395.Foreign<-DSP.1993.Foreign

JCP.9395.DomSoc<-JCP.1993.DomesticPolitics+JCP.1995.DomesticPolitics+JCP.1993.Societal+JCP.1995.Societal
JCP.9395.Economy<-JCP.1993.Economy+JCP.1995.Economy
JCP.9395.Foreign<-JCP.1993.Foreign+JCP.1995.Foreign


JNP.9395.DomSoc<-JNP.1993.DomesticPolitics+JNP.1993.Societal
JNP.9395.Economy<-JNP.1993.Economy
JNP.9395.Foreign<-JNP.1993.Foreign

JRP.9395.DomSoc<-JRP.1993.DomesticPolitics+JRP.1993.Societal
JRP.9395.Economy<-JRP.1993.Economy
JRP.9395.Foreign<-JRP.1993.Foreign


JSP.9395.DomSoc<-JSP.1993.DomesticPolitics+JSP.1995.DomesticPolitics+JSP.1993.Societal+JSP.1995.Societal
JSP.9395.Economy<-JSP.1993.Economy+JSP.1995.Economy
JSP.9395.Foreign<-JSP.1993.Foreign+JSP.1995.Foreign


LDP.9395.DomSoc<-LDP.1993.DomesticPolitics+LDP.1995.DomesticPolitics+LDP.1993.Societal+LDP.1995.Societal
LDP.9395.Economy<-LDP.1993.Economy+LDP.1995.Economy
LDP.9395.Foreign<-LDP.1993.Foreign+LDP.1995.Foreign


NPS.9395.DomSoc<-NPS.1993.DomesticPolitics+NPS.1995.DomesticPolitics+NPS.1993.Societal+NPS.1995.Societal
NPS.9395.Economy<-NPS.1993.Economy+NPS.1995.Economy
NPS.9395.Foreign<-NPS.1993.Foreign+NPS.1995.Foreign


REN.9395.DomSoc<-REN.1993.DomesticPolitics+REN.1993.Societal
REN.9395.Economy<-REN.1993.Economy
REN.9395.Foreign<-REN.1993.Foreign


NFP.9395.DomSoc<-NFP.1995.DomesticPolitics+NFP.1995.Societal
NFP.9395.Economy<-NFP.1995.Economy
NFP.9395.Foreign<-NFP.1995.Foreign


DRP.9395.DomSoc<-DRP.1995.DomesticPolitics+DRP.1995.Societal
DRP.9395.Economy<-DRP.1995.Economy
DRP.9395.Foreign<-DRP.1995.Foreign


GFU.9395.Economy<-GFU.1995.Economy
GFU.9395.Foreign<-GFU.1995.Foreign

HCC.9395.DomSoc<-HCC.1995.DomesticPolitics+HCC.1995.Societal
HCC.9395.Economy<-HCC.1995.Economy
HCC.9395.Foreign<-HCC.1995.Foreign


PCP.9395.DomSoc<-PCP.1995.DomesticPolitics+ PCP.1995.Societal
PCP.9395.Economy<-PCP.1995.Economy
PCP.9395.Foreign<-PCP.1995.Foreign


SPP.9395.DomSoc<-SPP.1995.DomesticPolitics+SPP.1995.Societal
SPP.9395.Economy<-SPP.1995.Economy
SPP.9395.Foreign<-SPP.1995.Foreign


DPJ.9698.DomSoc<-DPJ.1996.DomesticPolitics+DPJ.1998.DomesticPolitics+DPJ.1996.Societal+DPJ.1998.Societal
DPJ.9698.Economy<-DPJ.1996.Economy+DPJ.1998.Economy
DPJ.9698.Foreign<-DPJ.1996.Foreign+DPJ.1998.Foreign


DRP.9698.DomSoc<-DRP.1996.DomesticPolitics+DRP.1996.Societal
DRP.9698.Economy<-DRP.1996.Economy
DRP.9698.Foreign<-DRP.1996.Foreign


HCC.9698.DomSoc<-HCC.1998.DomesticPolitics+HCC.1998.Societal
HCC.9698.Economy<-HCC.1998.Economy
HCC.9698.Foreign<-HCC.1998.Foreign


CGP.9698.DomSoc<-CGP.1998.DomesticPolitics+CGP.1998.Societal
CGP.9698.Economy<-CGP.1998.Economy
CGP.9698.Foreign<-CGP.1998.Foreign


JCP.9698.DomSoc<-JCP.1996.DomesticPolitics+JCP.1998.DomesticPolitics+JCP.1996.Societal+JCP.1998.Societal
JCP.9698.Economy<-JCP.1996.Economy+JCP.1998.Economy
JCP.9698.Foreign<-JCP.1996.Foreign+JCP.1998.Foreign


JSP.9698.DomSoc<-SDP.1996.DomesticPolitics+SDP.1998.DomesticPolitics+SDP.1996.Societal+SDP.1998.Societal
JSP.9698.Economy<-SDP.1996.Economy+SDP.1998.Economy
JSP.9698.Foreign<-SDP.1996.Foreign+SDP.1998.Foreign


LDP.9698.DomSoc<-LDP.1996.DomesticPolitics+LDP.1998.DomesticPolitics+LDP.1996.Societal+LDP.1998.Societal
LDP.9698.Economy<-LDP.1996.Economy+LDP.1998.Economy
LDP.9698.Foreign<-LDP.1996.Foreign+LDP.1998.Foreign


LL.9698.DomSoc<-LL.1996.DomesticPolitics+LL.1996.Societal
LL.9698.Economy<-LL.1996.Economy
LL.9698.Foreign<-LL.1996.Foreign


LP.9698.DomSoc<-LP.1998.DomesticPolitics+LP.1998.Societal
LP.9698.Economy<-LP.1998.Economy
LP.9698.Foreign<-LP.1998.Foreign


NFP.9698.DomSoc<-NFP.1996.DomesticPolitics+NFP.1996.Societal
NFP.9698.Economy<-NFP.1996.Economy
NFP.9698.Foreign<-NFP.1996.Foreign


NSP.9698.DomSoc<-NSP.1996.DomesticPolitics+NSP.1998.DomesticPolitics+NSP.1996.Societal+NSP.1998.Societal
NSP.9698.Economy<-NSP.1996.Economy+NSP.1998.Economy
NSP.9698.Foreign<-NSP.1996.Foreign+NSP.1998.Foreign


NPS.9698.DomSoc<-NPS.1996.DomesticPolitics+NPS.1998.DomesticPolitics+NPS.1996.Societal+NPS.1998.Societal
NPS.9698.Economy<-NPS.1996.Economy+NPS.1998.Economy
NPS.9698.Foreign<-NPS.1996.Foreign+NPS.1998.Foreign





###### CREATE POLICY SPECIFIC WORDCOUNT DATASETS

### Set the number of times a word must occur in order to keep it
X<-3

#DOMESTIC AND SOCIAL POLITICS
domsoc<-as.data.frame(cbind(DSP.6064.DomSoc,JCP.6064.DomSoc,JSP.6064.DomSoc,LDP.6064.DomSoc,CGP.6569.DomSoc,DSP.6569.DomSoc,JCP.6569.DomSoc,JSP.6569.DomSoc,LDP.6569.DomSoc,CGP.7172.DomSoc,DSP.7172.DomSoc,JCP.7172.DomSoc,JSP.7172.DomSoc,LDP.7172.DomSoc,CGP.7679.DomSoc,DSP.7679.DomSoc,JCP.7679.DomSoc,JSP.7679.DomSoc,LDP.7679.DomSoc,NLC.7679.DomSoc,REN.7679.DomSoc,CGP.8083.DomSoc,DSP.8083.DomSoc,JCP.8083.DomSoc,JSP.8083.DomSoc,LDP.8083.DomSoc,NLC.8083.DomSoc,REN.8083.DomSoc,CGP.8690.DomSoc,DSP.8690.DomSoc,JCP.8690.DomSoc,JSP.8690.DomSoc,LDP.8690.DomSoc,NLC.8690.DomSoc,REN.8690.DomSoc,PP.8690.DomSoc,CGP.9395.DomSoc,DSP.9395.DomSoc,JCP.9395.DomSoc,JSP.9395.DomSoc,LDP.9395.DomSoc,REN.9395.DomSoc,NPS.9395.DomSoc,DRP.9395.DomSoc,JNP.9395.DomSoc,JRP.9395.DomSoc,CGP.9698.DomSoc,JCP.9698.DomSoc,JSP.9698.DomSoc,LDP.9698.DomSoc,NPS.9698.DomSoc,DRP.9698.DomSoc,NSP.9698.DomSoc,NFP.9698.DomSoc,LL.9698.DomSoc,LP.9698.DomSoc,DPJ.9698.DomSoc))
 
rownames(domsoc)<-dtafull[,1]

# Now: keep words mentioned more than X times (X is set to 3)
# and drop parties with 0 word count.

manifestolength<-colSums(domsoc)
domsoc<-subset(domsoc,select=manifestolength>0)
binarydta<-domsoc
binarydta<-ifelse(binarydta==0,binarydta<-0,binarydta<-1)
numberoccur<-rowSums(binarydta) 

period6064<-binarydta[,1:4]
period6569<-binarydta[,5:9]
period7172<-binarydta[,10:14]
period7679<-binarydta[,15:21]
period8083<-binarydta[,22:28]
period8690<-binarydta[,29:35]
period9395<-binarydta[,36:44]
period9698<-binarydta[,45:ncol(binarydta)]

periodoccur6064<-ifelse(rowSums(period6064)==0,periodoccur6064<-0,periodoccur6064<-1)
periodoccur6569<-ifelse(rowSums(period6569)==0,periodoccur6569<-0,periodoccur6569<-1)
periodoccur7172<-ifelse(rowSums(period7172)==0,periodoccur7172<-0,periodoccur7172<-1)
periodoccur7679<-ifelse(rowSums(period7679)==0,periodoccur7679<-0,periodoccur7679<-1)
periodoccur8083<-ifelse(rowSums(period8083)==0,periodoccur8083<-0,periodoccur8083<-1)
periodoccur8690<-ifelse(rowSums(period8690)==0,periodoccur8690<-0,periodoccur8690<-1)
periodoccur9395<-ifelse(rowSums(period9395)==0,periodoccur9395<-0,periodoccur9395<-1)
periodoccur9698<-ifelse(rowSums(period9698)==0,periodoccur9698<-0,periodoccur9698<-1)

periodoccur<-periodoccur6064+periodoccur6569+periodoccur7172+periodoccur7679+periodoccur8083+periodoccur8690+periodoccur9395+periodoccur9698
domsoc <-subset(domsoc,numberoccur>X & periodoccur>2)

#ECONOMY
economy<-as.data.frame(cbind(DSP.6064.Economy,JCP.6064.Economy,JSP.6064.Economy,LDP.6064.Economy,CGP.6569.Economy,DSP.6569.Economy,JCP.6569.Economy,JSP.6569.Economy,LDP.6569.Economy,CGP.7172.Economy,DSP.7172.Economy,JCP.7172.Economy,JSP.7172.Economy,LDP.7172.Economy,CGP.7679.Economy,DSP.7679.Economy,JCP.7679.Economy,JSP.7679.Economy,LDP.7679.Economy,NLC.7679.Economy,REN.7679.Economy,CGP.8083.Economy,DSP.8083.Economy,JCP.8083.Economy,JSP.8083.Economy,LDP.8083.Economy,NLC.8083.Economy,REN.8083.Economy,CGP.8690.Economy,DSP.8690.Economy,JCP.8690.Economy,JSP.8690.Economy,LDP.8690.Economy,NLC.8690.Economy,REN.8690.Economy,PP.8690.Economy,CGP.9395.Economy,DSP.9395.Economy,JCP.9395.Economy,JSP.9395.Economy,LDP.9395.Economy,REN.9395.Economy,NPS.9395.Economy,DRP.9395.Economy,JNP.9395.Economy,JRP.9395.Economy,CGP.9698.Economy,JCP.9698.Economy,JSP.9698.Economy,LDP.9698.Economy,NPS.9698.Economy,DRP.9698.Economy,NSP.9698.Economy,NFP.9698.Economy,LL.9698.Economy,LP.9698.Economy,DPJ.9698.Economy))
  
rownames(economy)<-dtafull[,1]

# Now: keep words mentioned more than X times (X is set to 1)
# and drop parties with 0 word count.

manifestolength<-colSums(economy)
economy <-subset(economy,select=manifestolength>0)
binarydta<-economy
binarydta<-ifelse(binarydta==0,binarydta<-0,binarydta<-1)
numberoccur<-rowSums(binarydta) 

period6064<-binarydta[,1:4]
period6569<-binarydta[,5:9]
period7172<-binarydta[,10:14]
period7679<-binarydta[,15:21]
period8083<-binarydta[,22:28]
period8690<-binarydta[,29:35]
period9395<-binarydta[,36:44]
period9698<-binarydta[,45:ncol(binarydta)]

periodoccur6064<-ifelse(rowSums(period6064)==0,periodoccur6064<-0,periodoccur6064<-1)
periodoccur6569<-ifelse(rowSums(period6569)==0,periodoccur6569<-0,periodoccur6569<-1)
periodoccur7172<-ifelse(rowSums(period7172)==0,periodoccur7172<-0,periodoccur7172<-1)
periodoccur7679<-ifelse(rowSums(period7679)==0,periodoccur7679<-0,periodoccur7679<-1)
periodoccur8083<-ifelse(rowSums(period8083)==0,periodoccur8083<-0,periodoccur8083<-1)
periodoccur8690<-ifelse(rowSums(period8690)==0,periodoccur8690<-0,periodoccur8690<-1)
periodoccur9395<-ifelse(rowSums(period9395)==0,periodoccur9395<-0,periodoccur9395<-1)
periodoccur9698<-ifelse(rowSums(period9698)==0,periodoccur9698<-0,periodoccur9698<-1)

periodoccur<-periodoccur6064+periodoccur6569+periodoccur7172+periodoccur7679+periodoccur8083+periodoccur8690+periodoccur9395+periodoccur9698
economy <-subset(economy,numberoccur>X & periodoccur>2)

#FOREIGN
foreign<-as.data.frame(cbind(DSP.6064.Foreign,JCP.6064.Foreign,JSP.6064.Foreign,LDP.6064.Foreign,CGP.6569.Foreign,DSP.6569.Foreign,JCP.6569.Foreign,JSP.6569.Foreign,LDP.6569.Foreign,CGP.7172.Foreign,DSP.7172.Foreign,JCP.7172.Foreign,JSP.7172.Foreign,LDP.7172.Foreign,CGP.7679.Foreign,DSP.7679.Foreign,JCP.7679.Foreign,JSP.7679.Foreign,LDP.7679.Foreign,NLC.7679.Foreign,REN.7679.Foreign,CGP.8083.Foreign,DSP.8083.Foreign,JCP.8083.Foreign,JSP.8083.Foreign,LDP.8083.Foreign,NLC.8083.Foreign,REN.8083.Foreign,CGP.8690.Foreign,DSP.8690.Foreign,JCP.8690.Foreign,JSP.8690.Foreign,LDP.8690.Foreign,NLC.8690.Foreign,REN.8690.Foreign,PP.8690.Foreign,CGP.9395.Foreign,DSP.9395.Foreign,JCP.9395.Foreign,JSP.9395.Foreign,LDP.9395.Foreign,REN.9395.Foreign,NPS.9395.Foreign,DRP.9395.Foreign,JNP.9395.Foreign,JRP.9395.Foreign,CGP.9698.Foreign,JCP.9698.Foreign,JSP.9698.Foreign,LDP.9698.Foreign,NPS.9698.Foreign,DRP.9698.Foreign,NSP.9698.Foreign,NFP.9698.Foreign,LL.9698.Foreign,LP.9698.Foreign,DPJ.9698.Foreign))
rownames(foreign)<-dtafull[,1]

# Now: keep words mentioned more than X times (X is set to 1)
# and drop parties with 0 word count.

manifestolength<-colSums(foreign)
foreign <-subset(foreign,select=manifestolength>0)
binarydta<-foreign
binarydta<-ifelse(binarydta==0,binarydta<-0,binarydta<-1)
numberoccur<-rowSums(binarydta) 


period6064<-binarydta[,1:4]
period6569<-binarydta[,5:9]
period7172<-binarydta[,10:14]
period7679<-binarydta[,15:21]
period8083<-binarydta[,22:28]
period8690<-binarydta[,29:35]
period9395<-binarydta[,36:44]
period9698<-binarydta[,45:ncol(binarydta)]

periodoccur6064<-ifelse(rowSums(period6064)==0,periodoccur6064<-0,periodoccur6064<-1)
periodoccur6569<-ifelse(rowSums(period6569)==0,periodoccur6569<-0,periodoccur6569<-1)
periodoccur7172<-ifelse(rowSums(period7172)==0,periodoccur7172<-0,periodoccur7172<-1)
periodoccur7679<-ifelse(rowSums(period7679)==0,periodoccur7679<-0,periodoccur7679<-1)
periodoccur8083<-ifelse(rowSums(period8083)==0,periodoccur8083<-0,periodoccur8083<-1)
periodoccur8690<-ifelse(rowSums(period8690)==0,periodoccur8690<-0,periodoccur8690<-1)
periodoccur9395<-ifelse(rowSums(period9395)==0,periodoccur9395<-0,periodoccur9395<-1)
periodoccur9698<-ifelse(rowSums(period9698)==0,periodoccur9698<-0,periodoccur9698<-1)

periodoccur<-periodoccur6064+periodoccur6569+periodoccur7172+periodoccur7679+periodoccur8083+periodoccur8690+periodoccur9395+periodoccur9698
foreign <-subset(foreign,numberoccur>X & periodoccur>2)


################ INCLUDE WORDIFSH CODE: WORDS ARE ROWNAMES!!

# WORDFISH Version 1.1 (May 2, 2008)

#######################################################
# Input:
# 1: wordcount matrix
# 2: Name of output file
# 3: tol   (tolerance criteria for convergence, default is 1e-7)
# 4: sigma (variance parameter to constrain beta, default is 3)
# 5: boot  (if TRUE runs parametric bootstrap, default is FALSE)
# 6: writeout (if TRUE writes three output files to working directory)
# 7: nsim  (number of bootstrap simulations if bootstrap is turned on, default is 500)
#######################################################

wordfish<- function(input,output="wordfish_output",tol=1e-7,sigma=3,boots=FALSE,writeout=FALSE,nsim=500) {    
    dta<-input          # we need to load data outside of wordfish so we can control what the data look like 
    words<- rownames(dta)        
    
    dta <- t(dta)
    nparty<-nrow(dta)  
    nword<-ncol(dta)
     
     cat("======================================\n")
     cat("WORDFISH (Version 1.1)\n")
     cat("======================================\n")
    cat("Number of unique words: ",nword,"\n")
    cat("Number of documents: ",nparty,"\n")
    cat("Tolerance criterion: ",tol,"\n")
    cat("======================================\n")

    # Generate starting values
    # ========================

    rockingstarts <- function(dta) {
        P <- nrow(dta)
        W <- ncol(dta)
        numword<-rep(1:W,each=P)
        numparty<-rep(1:P,W)
        dat <- matrix(1,nrow=W*P,ncol=3)
        dat[,1]<-as.vector(as.matrix(dta))
        dat[,2]<-as.vector(numword)
        dat[,3]<-as.vector(numparty)
        dat <- data.frame(dat)
        colnames(dat) <- c("y","word","party")
        dat$word <- factor(dat$word)
        dat$party <- factor(dat$party)

        # Starting values for psi   
        psi <- log(colMeans(dta))
        # Starting values for alpha
        alpha  <- log(rowMeans(dta)/rowMeans(dta)[1]) 

        # Starting values for beta and x        
        ystar <- log(dat$y+0.1) - alpha[dat$party] - psi[dat$word]
        res   <- svd(matrix(ystar,nrow(dta),ncol(dta),byrow=FALSE),nu=1)
        b <- as.vector(res$v[,1]*res$d[1])
        omega1 <- as.vector(res$u)-res$u[1,1]
        omega <- omega1/sd(omega1)
        b <- b*sd(omega1)

        # Create holding bins for some stuff for the convergence code
        min1<-c(rep(1,nrow(dta)-1))
        min2<-c(rep(1,ncol(dta)))
        iter<-0
        conv<-0
        diffparam<-0

        # Put everything together in a list
        list(alpha=as.vector(alpha),psi=as.vector(psi),b=b,omega=omega,
                   min1=min1,min2=min2,iter=iter,conv=conv,diffparam=diffparam)
    }


    # Log-Likelihood Functions (Poisson model)
    # ========================================

    llik_psi_b <- function(p,y,omega,alpha,sigma) { # beta and psi will be estimated 
        b   <- p[1]   
        psi <- p[2]
       lambda<-exp(psi+alpha+b*omega)                  # Lambda parameter for Poisson distribution
       -(sum(-lambda+log(lambda)*y)-0.5*(b^2/sigma^2)) # Log-likelihood including normal prior on Beta
    }


    llik_alpha_1 <- function(p,y,b,psi) { # omega[1] is estimated
        omega <- p[1]
        lambda<-exp(psi+b*omega)        # Lambda parameter; alpha is excluded b/c it is set to be zero
        -sum(-lambda+log(lambda)*y)     # Log-likelihood
    }

    llik_alpha_omega <- function(p,y,b,psi) { # all other omegas and alphas are estimated
        omega <- p[1]
        alpha <- p[2]
        lambda<-exp(psi+alpha+b*omega)      # Lambda parameter
        -sum(-lambda+log(lambda)*y)     # Log-likelihood
    }


    # Expectation-Maximization Algorithm
    # ==================================

    rockingpoisson <- function(dta,tol,sigma,params=NULL) {

        P <- nrow(dta)
        W <- ncol(dta)

        if (is.null(params)) {
            params <- rockingstarts(dta) # Call up starting value calculation
        }

        iter<-2
        maxllik<-cbind(-1e70,rep(0,1000))
        ll.words<-matrix(-1e70,W,1000)

        diffllik<-500

        # Set the convergence criterion 
        conv<-tol
        params$conv<-conv   

        while (diffllik>conv) { # Run algorithm if difference in LL > convergence criterion
            omegaprev<-params$omega
            bprev<-params$b   
            alphaprev<-params$alpha       
            psiprev<-params$psi 

            # ESTIMATE OMEGA AND ALPHA

            cat("Iteration",iter-1,"\n")
            cat("\tUpdating alpha and omega..\n")

            # Estimate first omega (alpha is set to 0)
            resa <- optim(p=c(params$omega[1]),
                        fn=llik_alpha_1,                        
                        y=as.numeric(dta[1,]),
                        b=params$b,
                        psi=params$psi,
                        method=c("BFGS")
                        )
                params$omega[1] <- resa$par[1]
                params$min1[1] <- -1.00*resa$value
                params$alpha[1] <- 0
                ifelse(resa$convergence!=0,print("Warning: Optim Failed to Converge!"),NA)

          # Estimate all other omegas and alphas    
            for (i in 2:P) {
                 resa <- optim(par=c(params$omega[i],params$alpha[i]),
                        fn=llik_alpha_omega,
                        y=as.numeric(dta[i,]),
                        b=params$b,
                        psi=params$psi)
                    params$omega[i] <- resa$par[1]
                    params$alpha[i] <- resa$par[2]
                    params$min1[i] <- -1.00*resa$value
                    ifelse(resa$convergence!=0,print("Warning: Optim Failed to Converge!"),NA)
                }    

            flush.console()


           # Z-score transformation of estimates for omega (to identify model)
           omegabar     <- mean(params$omega)
           b1       <- params$b
           params$b <- params$b * sd(params$omega)
           params$omega <- (params$omega - omegabar)/ sd(params$omega)
           params$psi <- params$psi + b1*omegabar  

        # ESTIMATE PSI AND BETA

        cat("\tUpdating psi and beta..\n")

              for (j in 1:W) {                        
                 resb <- optim(par=c(params$b[j],params$psi[j]),
                       fn=llik_psi_b,
                       y=dta[,j], 
                       omega=params$omega,
                       alpha=params$alpha,
                       sigma=sigma
                       )
                params$b[j] <- resb$par[1]
                params$psi[j] <- resb$par[2]
                params$min2[j] <- -1.00*resb$value
                ifelse(resa$convergence!=0,print("Warning: Optim Failed to Converge!"),NA)
                }    

             flush.console()

        # Calculate Log-Likelihood
        maxllik[iter]<-sum(params$min2)
        diffparam<-mean(abs(params$omega-omegaprev)) # difference between current and previous estimate for omega

        ll.words[,iter]<-params$min2
        diff.ll.words<-(ll.words[,iter]-ll.words[,iter-1])
        diffllik<-sum(diff.ll.words)/abs(maxllik[iter])
                        
          cat("\tConvergence of LL: ",diffllik,"\n")
        params$diffllik[iter-1]<-diffllik
        params$diffparam[iter-1]<-diffparam
        params$diffparam.last<-diffparam
        params$maxllik[iter-1]<-maxllik[iter]
        params$iter<-iter-1
        iter<-iter+1
        }    
         params$diffllik[1]<-NA 
         return(params)
    }


    # Run the algorithm

    est <- rockingpoisson(dta,tol,sigma) 

    # Write output
    output.documents <-cbind(est$omega,est$alpha)
    rownames(output.documents)<-rownames(dta)
    colnames(output.documents)<-c("omega","alpha")
    output.words   <-cbind(est$b,est$psi)
    rownames(output.words) <-words
    colnames(output.words) <-c("b","psi")

    # Write estimation output file
    # Include: Log-likelihood, iterations, number of words, number of documents

     output.estimation<-cbind(nword,nparty,est$iter,sum(est$min2),est$conv,est$diffparam.last)    
     colnames(output.estimation)<-c("Words","Documents","Iterations","Log-Likelihood","Convergence Criterion","Difference in X")

     if(writeout==TRUE){
        write.table(output.documents,file=paste(output,"documents.csv",sep="_"))
        write.table(output.words, file=paste(output,"words.csv",sep="_"))
        write.table(output.estimation, file=paste(output,"estimation.csv",sep="_"))
      }

     ###########################
     # Parametric Bootstrap Code
     ###########################

     bootstrap<-function(nsim,output.documents,output.words,nparty,nword) {

        cat("STARTING PARAMETRIC BOOTSTRAP\n")

        # input alpha and omega from estimation
        alpha.omega<-output.documents

        # input psis and betas from estimation
        psi.beta<-output.words

        # Create matrix of results.
        output.se.omega<-matrix(0,nparty,nsim)
        output.se.b<-matrix(0,nword,nsim)

        alpha<-alpha.omega[,2] 
        omega<-alpha.omega[,1]
        psi<-psi.beta[,2] 
        b<-psi.beta[,1]

        # create data matrix
        dtasim<-matrix(1,nrow=nparty,ncol=nword)

        for (k in 1:nsim){

            cat("Simulation ",k,"\n")

             # Generate new data using lambda 
            for (i in 1:nparty) {
                dtasim[i,]<-rpois(nword,exp(psi+alpha[i]+b*omega[i]))  
                }

            alphastart<-alpha+rnorm(length(alpha.omega[,1]),mean=0,sd=(sd(alpha.omega[,2])/2))
            omegastart<-omega+rnorm(length(alpha.omega[,1]),mean=0,sd=(sd(alpha.omega[,1])/2))
            psistart<-psi+rnorm(length(psi.beta[,1]),mean=0,sd=(sd(psi.beta[,2])/2))
            bstart<-b+rnorm(length(psi.beta[,1]),mean=0,sd=(sd(psi.beta[,1])/2))
            params<-list(alpha=alphastart,omega=omegastart,psi=psistart,b=bstart)      

            est <- rockingpoisson(dtasim,tol,sigma,params=params)

            # Store omegas 
            output.se.omega[,k]<-est$omega
            # Store Bs
            output.se.b[,k]<-est$b
            }


        conf.documents<-matrix(0,nparty,4)
        colnames(conf.documents)<-c("LB","UB","Omega: ML","Omega: Sim Mean")
        rownames(conf.documents)<-rownames(dta)
        for (i in 1:nparty) {
            conf.documents[i,1]<-quantile(output.se.omega[i,],0.025)
            conf.documents[i,2]<-quantile(output.se.omega[i,],0.975)
            conf.documents[i,3]<-omega[i]
            conf.documents[i,4]<-mean(output.se.omega[i,])
            }



        #CI for word weights
        conf.words<-matrix(0,nword,4)
        colnames(conf.words)<-c("LB","UB","B: ML","B: Sim Mean")
        rownames(conf.words)<-words
        
      
        for (i in 1:nword) {
            conf.words[i,1]<-quantile(output.se.b[i,],0.025)
            conf.words[i,2]<-quantile(output.se.b[i,],0.975)
            conf.words[i,3]<-b[i]
            conf.words[i,4]<-mean(output.se.b[i,])
            }

           return(list(conf.documents=conf.documents,conf.words=conf.words))
        }

        if(boots==TRUE){ 
             bootresult<-bootstrap(nsim,output.documents,output.words,nparty,nword) 
             ci.documents<-bootresult$conf.documents
             ci.words<-bootresult$conf.words

             if(writeout==TRUE){
                   write.table(ci.words,file=paste(output,"words_95_ci.csv",sep="_"))
                   write.table(ci.documents,file=paste(output,"documents_95_ci.csv",sep="_"))
             }

        }

        if(boots==F){
             ci.documents<-NULL
             ci.words<-NULL
        }

cat("Finished!\n")

return(list(documents=output.documents,words=output.words,diffllik=est$diffllik,diffomega=est$diffparam,maxllik=est$maxllik,estimation=output.estimation,ci.documents=ci.documents,ci.words=ci.words))



}


# Run Wordfish
#wordfish.jp.domsoc<-wordfish(domsoc,"domsoc_10Aug09", boot=T, writeout=T)
#wordfish.jp.economy<-wordfish(economy,"econ_10Aug09", boot=T, writeout=T)
wordfish.jp.foreign<-wordfish(foreign,"for_10Aug09", boot=T, writeout=T)

